10 More Discussions You Might Find Interesting
1. 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
2. Shell Programming and Scripting
Hi Folks,
This is the first time I ever encountered this situation
My input file is of this kind
cat input.txt
1 PAIXAF 0 1 1 -9 0 0 0 1 2 0 2 1 2 1
7 PAIXEM 0 7 1 -9 1 0 2 0 1 2 2 1 0 2
9 PAKZXY 0 2 1 -9 2 0 1 1 1 0 1 2 0 1
Till the sixth column (which is -9), I want my columns to... (4 Replies)
Discussion started by: jacobs.smith
4 Replies
3. Shell Programming and Scripting
Hi, I need to display the last column value in the below o/p.
sam2 PS 03/10/11 0 441
Unable to get o/p with this awk code
awk -F"+" '{ print $4 }' pwdchk.txt
I need to display 441(in this eg.) and also accept it as a variable to treat it with if condition and take a decision.... (1 Reply)
Discussion started by: sam_bd
1 Replies
4. Shell Programming and Scripting
Hi,
I have a problem to concatenate the lines based on number of delimiters (if the delimiter count is 9 then concatenate all the fields & remove the new line char bw delimiters and then write the following data into second line) in a file.
my input file content is
Title| ID| Owner|... (4 Replies)
Discussion started by: bi.infa
4 Replies
5. Shell Programming and Scripting
Hello
If you wanted to sort a .csv file that was filled with lines like this:
<Ticker>,<Date as YYYYMMDD>,<Time as H:M:S>,<Volume>,<Corr>
(H : , M, S: )
by date, does anybody know of a better solution than to turn the 3rd and 4th colons of every line into commas, sorting on four keys,... (20 Replies)
Discussion started by: Ryan.
20 Replies
6. Shell Programming and Scripting
I have the following string sample:
bla bla bla bla bla
I would like to extract the "123" using awk.
I thought about awk -F"]" '{ print $1 }' but it doesn't work
Any ideas ? (7 Replies)
Discussion started by: gdub
7 Replies
7. Shell Programming and Scripting
Hi All,
I am encountered with a problem while sorting a file based on multiple columns . I need to sort like:
(field2,ascending) , (field3,ascending) ,(field8,descending) , (field7,ascending),(field13,ascending).
So far i was sorting only in ascending order but here i need to use one... (1 Reply)
Discussion started by: apjneeraj
1 Replies
8. Shell Programming and Scripting
Hi,
I have a requirement whereby I have to sort a flat file based on Multiple Columns (similar to ORDER BY Clause of Oracle). I am getting 10 columns in the flat file and I want the file to be sorted on 1st, 3rd, 4th, 7th and 9th columns in ascending order. The flat file is pipe seperated.
Any... (15 Replies)
Discussion started by: dharmesht
15 Replies
9. Shell Programming and Scripting
Hi
I wanted to cut the feilds comming after % and After $ at one go
can we do some thing like this cut -f 2 -d "%|$" (But it doesnot work)
Input File
BWPG %TCPRP1 $SCSPR000
BWPH %TCPRP1 $SCSPR003
BWPI %TRTYUP ResourceDescription="IMPRIMANTE " $BWOPTY
BWPJ %ZOMBIE ... (4 Replies)
Discussion started by: pbsrinivas
4 Replies
10. Shell Programming and Scripting
Hi,
I have an urgent task here. I am required to sort a flat file based on multiple columns which are based on the character position in that line. I am restricted to use the character position instead of the space and sort +1 +2 etc to do the sorting.
I understand that there is a previous... (8 Replies)
Discussion started by: cucubird
8 Replies