10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Friends,
Below is my input file with "|" (pipe) as filed delimiter:
My Input File:
HDR|F1|F2||||F6|F7
I want to inser values in the record for field 4 and field 5.
Expected output
HDR|F1|F2||F4|F5|F6|F7
I am able to append the string to the end of the record, but not in between the... (3 Replies)
Discussion started by: Ajay Venkatesan
3 Replies
2. Shell Programming and Scripting
Hi All,
I am trying to insert two columns in the following text. I tried awk but failed to achieve. Highly appreciate your help
DATETIME="28-Sep-2013;20:09:08;"
CONTROL="AB"
echo "Myfile.txt;11671;7824.90;2822.48"
The DATETIME will be inserted at the beginning and CONTROL will... (4 Replies)
Discussion started by: angshuman
4 Replies
3. UNIX for Dummies Questions & Answers
Hi !
input:
111|222|333|aaa|bbb|ccc
999|888|777|nnn|kkk
444|666|555|eee|ttt|ooo|ppp
With awk, I am trying to change the FS "|" to "; " only from the 4th field until the end (the number of fields vary between records).
In order to get:
111|222|333|aaa; bbb; ccc
999|888|777|nnn; kkk... (1 Reply)
Discussion started by: beca123456
1 Replies
4. Shell Programming and Scripting
sample file (comma as field separators)
MessageFlow,1,BusIntBatchMgr,a
OOBEvent,1,BusIntBatchMgr,a
TaskEvents,1,,a
MTTrace,1,,a
MTWarning,,1,a
MessageFlow,1,Batch,a
OOBEvent,1,Batch,a
TaskEvents,1,,a
EAISAPIdocWizard,1,BusIntMgr,a
EAISAPBAPIWizard,1,BusIntMgr,a... (3 Replies)
Discussion started by: vrclm
3 Replies
5. UNIX for Dummies Questions & Answers
Hello,
I have about 100 files in a directory with fields which are tab delimited. I would like to append the file name as the first field and it has to be done as many times as the total lines in the file.
For example,
myFile1.txt has the following data:
1 x y z
2 a b ... (5 Replies)
Discussion started by: Gussifinknottle
5 Replies
6. Shell Programming and Scripting
Hello,
Can someone help me to do this with awk or sed? I have a file with multiple lines, each line has many fields separated with a tab. I would like to add one more field holding 'na' in between the first and second fields.
old file looks like,
1, field1 field2 field3 ...
2, field1... (7 Replies)
Discussion started by: ssshen
7 Replies
7. Shell Programming and Scripting
Dear All,
I have the following input file. I want to replace data with null values.
I/P File:
9022334455|2008-12-06 06:10:21|2|Error@@@|esoo8erp|
9024334432|2008-12-06 08:40:59|6|Error@@@|6y2o8e6r|
O/P File:
9022334455||2||esoo8erp|
9024334432||6||6y2o8e6r|
... (4 Replies)
Discussion started by: hanu_oracle
4 Replies
8. Shell Programming and Scripting
Greets all,
I'm using Perl trying to insert an IP address from a log file into an INT field in a MYSQL table. So it needs to be converted into an int first. I thought the pack() function could do this for me, but I'm not sure I get the right thing. I also need to be able to extract it correctly... (3 Replies)
Discussion started by: otheus
3 Replies
9. UNIX for Dummies Questions & Answers
print "count,pub,prodline,group,sector,date,source" > $fname
cat sp_log.summary.$firstday-$lastday.ProdlineSector | sed "s/^ *//g;s/ *$//g" >sp_log.summary.$firstday-$lastday
cat sp_log.summary.$firstday-$lastday | sed "s/$/ $lastyy-$lastmm cache/;s/ /,/g" >> $fname
cat $fname | sed... (1 Reply)
Discussion started by: shikhakaul
1 Replies
10. UNIX for Dummies Questions & Answers
EOD backup failed with following error:
05/08/07 01:10:02
write /home/compdir to DATTAPE
2712860 blocks
UX: cpio: HALT: Cannot read from device
1 error
Failed on shell-script:
cpio -ictB 2>>/home2/Rev83/misc/logs/bk.End-of-day 1>/dev/null </dev/rct0
05/08/07 2:29:14
What above output... (0 Replies)
Discussion started by: nervous
0 Replies