10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Original content:
ACACCTCAT 129 | ACACCTCAT 0
ACACCTCATX 171 | ACACCTCATX 0
ACACRESRT 0 ACACRESRT 0
ACACRESRTX 0 ... (4 Replies)
Discussion started by: loktamann
4 Replies
2. Shell Programming and Scripting
Hey guys,
I have a file that is delimited by | and I am trying to write a sed command to
convert this:
abc|def||ghi|jkl||||mnop
into this:
abc|def|-|ghi|jkl|-|-|-|mnop
The output I am getting out of:
sed -e "s/+//g" /tmp/opt.del > /tmp/opt2.del
is like:
... (9 Replies)
Discussion started by: prohank
9 Replies
3. Shell Programming and Scripting
Hi,
I have a requirement where in I need to insert delimiters before the last column of the total delimiters is less than a specified number.
Say if the delimiters is less than 139, I need to insert 2 columns ( with blanks) before the last field
awk -F 'Ç' '{ if (NF-1 < 139)} END { "Insert 2... (5 Replies)
Discussion started by: arunkesi
5 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
I have a set of data as below :
XS012371378 Raj 23-09-12
SH128238948 Andrew 24-08-12
CH273712399 Walsh 12-10-12
JK7249923893 Nick 10-02-13
JP6383791389 Braslin 30-12-13
I want the first column to be extracted separately. I can get this using awk.
awk '{print $1}' file_name
... (3 Replies)
Discussion started by: Nand Kishor
3 Replies
5. Shell Programming and Scripting
Having a huge file in the following format.
2,3,1,,,4
1,2,3,,,,,5,
8,7,3,4,,,,
Output needed is:
2,3,1,0.0,0.0,4
1,2,3,0.0,0.0,0.0,0.0,5,
8,7,3,4,0.0,0.0,0.0,
I have tried reading the file each line, using AWK to parse to find out ",," and then insert 0.0 . It works but very slow. Need... (8 Replies)
Discussion started by: wincrazy
8 Replies
6. Shell Programming and Scripting
Hi,
I am trying to insert Inverted Commas around all the numeric values within a comma seperated string / variable.
1111,2222,3333,4444
I would like it to be:
'1111','2222','3333','4444'
Note - This string could have a differing amount of numeric values each time the variable is... (4 Replies)
Discussion started by: RichZR
4 Replies
7. Shell Programming and Scripting
Can someone please help?I have a file - fixed.txt----------------------------AABBBBCCCCCCDDDEEFFFFGGGGGGHHHIIJJJJKKKKKKLLL----------------------------To insert delimiters at fixed lengths of 2, 4, 6, 3, I created a file text1.txt as-------------------2463----------------------and trying to execute... (10 Replies)
Discussion started by: jd_mca
10 Replies
8. UNIX for Dummies Questions & Answers
Hi
I have a text file which is position delimited, i.e.
Code1 Description1 Value1
Code2 Description2 Value2 etc.
I want to import this file into MySQL so I want to convert the file into Comma delimited format.
To do this I want to insert commas at fixed positions on... (7 Replies)
Discussion started by: arossco
7 Replies
9. UNIX for Dummies Questions & Answers
Hi,
Newbie here. I have a file that consists of data that I want to convert to a csv file. For example:
Jul 20 2008 1111 / visit home / BlackBerry8830/4.2.2 Profile/MIDP-2.0 Configuration/CLOC-1.1 VendorID/105
Jul 21 2008 22222 / add friend / BlackBerry8830/4.2.2 Profile/MIDP-2.0... (3 Replies)
Discussion started by: kangaroo
3 Replies
10. Shell Programming and Scripting
I'm working with a file like:
somestuff
somemorestuff
...
someadditionalstuff
STARTTAG
ENDTAG
someotherstuff
somecoolstuff
...
somefinalstuffI've got some text (either in a file or piped) to put between STARTTAG and ENDTAG. I was thinking something like grepping for the line number of... (2 Replies)
Discussion started by: BMDan
2 Replies