10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
If a file has following kind of data, comma delimited
1,2,3,4
1
1
1,2,3,4
1,2
2
2,3,4
My required output must have only 4 columns with comma delimited
1,2,3,4
111,2,3,4
1,222,3,4
I have tried many awk command using ORS="" but couldnt progress (10 Replies)
Discussion started by: mdkm
10 Replies
2. UNIX for Dummies Questions & Answers
Hypothetically, suppose that
file1
id v1 v2 v3 v4 v5 v6 v7..........v100
1 1 1 1 1 1 2 2 .....50
2 1 1 1 1 1 2 2 .....50
3 1 1 1 1 1 2 2 .....50
4 1 1 1 1 1 2 2 .....50
5 1 1 1 1 1 2 2 .....50
I want to write a loop such that I take the id# and the first 5 columns (v1-v5) into the... (3 Replies)
Discussion started by: johnkim0806
3 Replies
3. Shell Programming and Scripting
i want to replace mistaken quotes in line starting with tag 300 and relocate the quote in the correct position so the input is
223;25
224;20100428064823;1;0;0;0;0;0;0;0;8;1;3;9697;18744;;;;;;;;;;;;
300;X;Event:... (3 Replies)
Discussion started by: wradwan
3 Replies
4. Shell Programming and Scripting
Hello. I'm trying to write a script to take a 5 field file, do some math, and extend it to 9 fields. Problem is, the script keeps wrapping it to two lines, even tho 9 fields, tab separated (even comma separated) doesn't fill the screen. Even if it did, I'm eventually copying it to an excel ... (2 Replies)
Discussion started by: JoeNess
2 Replies
5. AIX
$ indicates blank space
file1.txt:
001_AHaris$$$$$020$$$$$$$$$
001_ATony$$$$$$030$$$$$$$$$
002_AChris$$$$$090$$$$$$$$$
002_ASmit$$$$$$060$$$$$$$$$
003_AJhon$$$$$$001$$$$$$$$$
$ indicates blank space
code
while read "LINE"; do
echo "$LINE" | cut -c6- >> $(echo "$LINE" | cut... (1 Reply)
Discussion started by: techmoris
1 Replies
6. Shell Programming and Scripting
Dear All,
Is there a way to cut the lines that have been "head"
Here is what i m trying to do Please advice
there is file name dummy.txt
now i am trying to head this file 4 time by using a loop and every time this file is head with different values
e.g in first instance it will... (7 Replies)
Discussion started by: jojo123
7 Replies
7. Shell Programming and Scripting
I've looked at the join command which is able to perform what I need on two rows with a common field, however if I have more than two rows I need to join all of them.
Thus I have one file with multiple rows to be joined on an index number:
1 randomtext1
2 rtext2
2 rtext3
3 rtext4
3 rtext5... (5 Replies)
Discussion started by: crimper
5 Replies
8. Shell Programming and Scripting
hi,
I have this code:
#!/usr/bin/ksh
#SERVICES
gzcat *SERVICES* | awk '
{
SUBSCRIBERNUMBER=substr($0,1,20)
SUBSCRIBERNUMBER=trim(SUBSCRIBERNUMBER)
SERVICECODE=substr($0,22,61)
SERVICECODE=trim(SERVICECODE)
STARTDD=substr($0,63,72)
STARTDD=trim(STARTDD)
STARTDT=substr($0,74,81)... (1 Reply)
Discussion started by: naoseionome
1 Replies
9. UNIX for Dummies Questions & Answers
Data begins as such;
Mar 16 03:27:05 afzpimdn01 named: denied update from .3983 for "nnn.nnn.in-addr.arpa" IN
Mar 16 03:27:37 afzpimdn01 named: denied update from .4844 for "nnn.nnn.in-addr.arpa" IN
Mar 16 03:27:56 afzpimdn01 named: denied update from .2650 for "nnn.nnn.in-addr.arpa" IN
... (4 Replies)
Discussion started by: altamaha
4 Replies
10. UNIX for Dummies Questions & Answers
Hey all. I have a file that I am trying to cut information out of. We have a script that shows us all of our Radio Scanners that are being used and I'm writing a script that clears all of the context off of the scanners. The script that runs shows us this information below...
|emp_id ... (5 Replies)
Discussion started by: jalge2
5 Replies