top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Pattern string

0 votes
250 views

Design, Develop and Implement a Program in C for the following operations on Strings.
a. Read a main String (STR), a Pattern String (PAT) and a Replace String (REP)
b. Perform Pattern Matching Operation: Find and Replace all occurrences of PAT in
STR with REP if PAT exists in STR. Report suitable messages in case PAT does not
exist in STR
Support the program with functions for each of the above operations. Don't use Built-in
functions.

posted Oct 6, 2020 by Madhu L

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
0 votes

Data file look:-
6 invoices. Each line represent 1 invoice data. Each column separated by | pipe.

7031982|BALANCE|000000 rent on 23/03/2019|0768|110241|385272|PETTY CASH OLAYAN|VENDOR|BPV2019-3|
7031986|BALANCE|000000|0768|226005|388883|\NOMAN\12\as\|EMPLOYEE|BPV2019-377|
7031986|BALANCE|000000|0768|226011|388883| NOMAN|EMPLOYEE|BPV2019-377|
7031986|BALANCE|000000|0768|240007|388883| NOMAN|EMPLOYEE|BPV2019-377|
7032003|BALANCE|000000|0703|231085|384173|WATER COMPANY|VENDOR|BPV2|
7032003|BALANCE|033511|0768|503000|384173|WäTER COMPANY|VENDOR|BPV2|

Requirement:- I need a bat file which will correct existing file

Some times we get the data like:-
1. |1797 \krv\Fice\AP\klo|
==> this should convert like || (just removing complete data within |)
2. |\krv\Finance\Finance\ap\INS12O|
==> this should convert like || (just removing complete data within |)
3. |\as\sa\1\as\|
==> this should convert like || (just removing complete data within |)
4. |second rent at cal on 23/05/2019|
==> this should convert like |second rent at cal on 23-05-2019| (just replace / with - )
5. | Johannes Märkl Monatsrechnung|
==> this should convert like | Johannes Markl Monatsrechnung | (just replace ä with a )

below is code

    @echo off
setlocal enabledelayedexpansion

(for /f "delims=" %%a in (a30077889.txt) do (
  set "line=%%a"
  set "newline="
  for %%b in ("!line:|=" "!") do (
    set "token=%%~b"
    if "!token:~0,1!"=="\" (
     set "newline=!newline!|"
    ) else (
      set "newline=!newline!%%~b|"
    )
  )
  echo !newline:~0,-1!
))>a.new
REM move /y a.new a30077889.txt
+1 vote

The command to convert from .xlsx to csv works in putty, but the same when given in informatica fails....I am getting exit error code 32512.

The workflowlog >>

Severity    Timestamp   Node    Thread  Message Code    Message
INFO    9/8/2016 5:28:20 PM Node_BIDEV  140284941813504 LM_36621    Command task instance [Convert_csv]: started command [convert], with pid [14121] on node [Node_BIDEV].
ERROR   9/8/2016 5:28:21 PM Node_BIDEV  140285390595840 LM_36623    Command task instance [Convert_csv]: execution of command [convert] did not complete successfully with exit code [32512]
WARNING 9/8/2016 5:28:21 PM Node_BIDEV  140285390595840 LM_36626    Command task instance [Convert_csv]: previous command [convert] failed and "run if previous command succeeded" option is set, the remaining commands will not be run.
ERROR   9/8/2016 5:28:21 PM Node_BIDEV  140285390595840 LM_36320    Command task instance [Convert_csv]: Execution failed.
WARNING 9/8/2016 5:28:21 PM Node_BIDEV  140285390595840 LM_36373    Workflow [wf_CUSTOMER_SURVEY_CORE_DailyFiles] is suspended.
INFO    9/8/2016 5:28:22 PM Node_BIDEV  140285390595840 LM_36375    Workflow [wf_CUSTOMER_SURVEY_CORE_DailyFiles]: Sent suspension email to email user 
WARNING 9/8/2016 5:28:27 PM Node_BIDEV  140284973283072 LM_36371    Workflow [wf_CUSTOMER_SURVEY_CORE_DailyFiles] is aborting.
WARNING 9/8/2016 5:28:27 PM Node_BIDEV  140284973283072 LM_36322    Workflow [wf_CUSTOMER_SURVEY_CORE_DailyFiles]: Execution aborted.

The command script I am using is

libreoffice --headless --convert-to csv:"Text - txt - csv (StarCalc)":"126,0,76,1,2" /var/opt/load/Sourcedata/CUSTOMER_SURVEY/2016Q2_ML_V1.xlsx

Please help me...

0 votes

Write a unix command to display the every character in the word "QUERYHOME" in new line.

Ex : Input - QUERYHOME
output: Q
U
E
R
Y
H
O
M
E

...