I have a strange issue with large files and bash. This is the context:
I have a large file: 75G and 400,000,000+ lines (it is a log file, my bad, I let it grow).
The first 10 chars of each line is a time stamps in the format YYYY-MM-DD.
I want to split that file: one file per day.
I tried with the following script that did not work.
I am trying to add a line to a bash script that does a bunch of other stuff and what I want it to do is write to the end of a line in another file. I have a file with a line of IP addresses which is all one line. This script that I have written asks for user input and one of those things it asks for is an IP address.
I would like to write a script that takes something like this:
Line 1
Line 2
Line 3
Line 4
[Blank line]
Line 6
Line 7
Line 8
Line 9
[Blank line]
etc....
And makes it to look like this:
Line 1|Line 2|Line 3|Line 4|[Blank line, if it's easier]
Line 6|Line 7|Line 8|Line 9|[Blank line, if it's easier]
etc.
I would think it would be fairly easy to use two loops, one for the the 5-li
My end goal is to read some weather information from a text or xml file, extract the temperature and write it on an image file using convert. I am trying to take it one step at a time learn a little and improve on my bash scrip.
I am trying to use ed to edit the first line of a large file, but I have to wait for ed to read all lines. Is there any way I could stop ed from reading the whole file and start editing immediately, with the current line being the first line?
i have 3 files as below:
Code:
[test1][test2][test3]
i want to print 1st,2nd,5th and 10th filed of 1st to 5th lines from each files into a line of an output file, so the result would be:
[output]:
Code:
{line1}(field 1 of line 1 from file 1)(field 2 of line 1 from file 1)(field 5 of line 1 from file 1)(field 10 of line 1 from file 1)...(field 10 of line 5 from file 1)
{line2}(field 1
Hi All,
I'm writing a script to read a file line by line and then perform awk function on it. I am getting an error . My file has one name in it "James".
Is there a way to use the "paste" command to combine files and have each line key off of a column? All this time I've been pasting files together and foolishly not checking the line count of each file. I have just found out that the line count is not the same for each file so the data is not being synchronised properly across the two files.
hey all,
I have this code :
Code:
#!/bin/tcsh -f
set line=($<)
while($#line > 0)
echo $line[1]
set line=($<)
end
the usage to run the script would be :
Code:
./file < file2
Is there a way to specify filename in the script itself instead of getting/reading file name from STDIN ?
Using :
Code:
set file=data
instead of :
Code:
set line=($&