10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear All,
I have been trying to do a simple task of extracting 2 fields from the file (3 rows) and store it in an array variable. I tried with:
#! /bin/bash
ch=`cut -f10 tmp.txt`
counter=0
for p in $pid
do
c=${ch}
echo "$c ..$counter"
counter=$((counter+1))... (2 Replies)
Discussion started by: ezhil01
2 Replies
2. Shell Programming and Scripting
Hi,
I have a huge file with a single line.
But I want to break that line into lines of with each line having five columns.
My file is like this:
code:
"hi","there","how","are","you?","It","was","great","working","with","you.","hope","to","work","you."
I want it like this:
code:... (1 Reply)
Discussion started by: rajsharma
1 Replies
3. Shell Programming and Scripting
into small files. i need to add a head.txt and tail.txt into small files at the begin and end, and give a name as q1.xml q2.xml q3.xml ....
thank you very much. (2 Replies)
Discussion started by: dtdt
2 Replies
4. UNIX for Advanced & Expert Users
Hi All,
I have a very huge file (4GB) which has duplicate lines. I want to delete duplicate lines leaving unique lines. Sort, uniq, awk '!x++' are not working as its running out of buffer space.
I dont know if this works : I want to read each line of the File in a For Loop, and want to... (16 Replies)
Discussion started by: krishnix
16 Replies
5. Shell Programming and Scripting
Hi
I want to write a script which store all the parameters passed to the script into an array.
Once it is stored I want scan through the array and and delete those files for last month present inside the directory. The files in directory is appneded with YYYY_MM_DD.
I want to know how can I... (3 Replies)
Discussion started by: dgmm
3 Replies
6. Shell Programming and Scripting
Hi Guys,
I have a file which has numbers in it separated by newlines as follows:
1.113
1.456
0.556
0.021
-0.541
-0.444
I am using the following code to store these in an array in bash:
FILE14=data.txt
ARRAY14=(`awk '{print}' $FILE14`) (6 Replies)
Discussion started by: npatwardhan
6 Replies
7. UNIX for Dummies Questions & Answers
Dear All,
I am working with windoes OS but remote a linux machine. I wonder the way to copy an paste some part of a huge file in linux machine.
the contain of file like as follow:
...
dump annealling all custom 10 anneal_*.dat id type x y z q
timestep 0.02
run 200000
Memory... (2 Replies)
Discussion started by: ariesto
2 Replies
8. Shell Programming and Scripting
Dear all,
I have a file having the following formats:
ThreadFail=Web1=1234
ThreadFail=Web2=2345
ThreadFail=Web3=12
ConnectionFail=DB1=11
ConnectionFail=DB2=22
The number of lines will be different from every time . How can I parse the file and store the result to an a array inside... (6 Replies)
Discussion started by: youareapkman
6 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I do have a file and the contents are as follws:
10
20
30
40
50
Now I want to store those values into an array. How can be done this ?? (3 Replies)
Discussion started by: risshanth
3 Replies
10. Shell Programming and Scripting
I have to delete 1st 7000 lines of a file which is 12GB large. As it is so large, i can't open in vi and delete these lines. Also I found one post here which gave solution using perl, but I don't have perl installed. Also some solutions were redirecting the o/p to a different file and renaming it.... (3 Replies)
Discussion started by: rahulrathod
3 Replies