10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a file like below.
1,2,3,4,5,6,7,8,9I would like to print or copied to a file based of line count in perl
If I gave a condition 1 to 3 then it should iterate over above file and print 1 to 3 and then again 1 to 3 etc.
output should be
1,2,3
4,5,6
7,8,9 (10 Replies)
Discussion started by: Anjan1
10 Replies
2. Shell Programming and Scripting
hi Gurus,
I need separate a file which is one huge line to multiple lines based on certain number of charactors. for example:
abcdefghi high abaddffdd
I want to separate the line to multiple lines for every 4 charactors.
the result should be
abcd
efgh
i hi
gh a
badd
ffdd
Thanks in... (5 Replies)
Discussion started by: ken6503
5 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I have written a script that returns the line number of the pattern i want and i stored the line number in a variable.Now i want to delete all the lines in a file above this line number which is stored in a variable.
i am using sed '1,$getlinenumberd' > file1.txt which is not working(wrog... (5 Replies)
Discussion started by: learninguser235
5 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I have written a script that returns the line number of the pattern i want and i stored the line number in a variable(getlinenumber).Now i want to delete all the lines in a file above this line number which is stored in a variable.
i am using sed '1,$getlinenumberd' > file1.txt which is... (2 Replies)
Discussion started by: learninguser235
2 Replies
5. Shell Programming and Scripting
Hi
I am using the following command to delete a line from the file by line number:
line_number=14
sed "${line_number}d" inputfilename > newfilename
Is there a way to modify this command to specify the range of lines to be deleted, lets say from line 14 till line 5 ?
I tried using the... (5 Replies)
Discussion started by: aoussenko
5 Replies
6. Shell Programming and Scripting
I have a file that contains 87 lines, each with a set of coordinates (x & y). This file looks like:
1 200.3 -0.3
2 201.7 -0.32
...
87 200.2 -0.314
I have another file which contains data that was taken at certain of these 87 positions. i.e.:
37 125
42 175
86 142
where the first... (1 Reply)
Discussion started by: jackiev
1 Replies
7. Shell Programming and Scripting
This is a variation of an earlier post found here:
unixcom/shell-programming-scripting/159821-merge-two-non-consecutive-lines.html
User Bartus11 was kind enough to solve that example.
Previously, I needed help combining two lines that are non-consecutive in a file. Now I need to do the... (7 Replies)
Discussion started by: munkee
7 Replies
8. Shell Programming and Scripting
I have file with 10000 records and i need to delete the lines in single shot based on line number range say from 10 to 51 , 53 to 59 , 105 to 107, 311 to 592 etc... between range works fine for me but how to achive for above case? please help
sed '10,51 {d}' infile > outfile (5 Replies)
Discussion started by: zooby
5 Replies
9. UNIX for Dummies Questions & Answers
I have been googling, but cannot find that works for me.
I have a text file tmp.out with contents:
sadfsdf sdfosuidhfousdhof soduhf osdfu osudfhosudhfd
sdfgsdfg
asdfiojhsdf asdoludhflsdjfhskldjfhsdjdlfsjdhnlj h sdja
ouahsdjdafkljsa
oljhljh
I have another file... (11 Replies)
Discussion started by: ChicagoBlues
11 Replies
10. Shell Programming and Scripting
Hello, I need help in appending the line number of each line to the file and also to get the total number of lines. Can somebody please help me.
I have a file say:
abc
def
ccc
ddd
ffff
The output should be:
Instance1=abc
Instance2=def
Instance3=ccc
Instance4=ddd
Instance5=ffff
... (2 Replies)
Discussion started by: chiru_h
2 Replies