I have a data list, like
12345
23456
67891
-20000
200
600
20
...
Assume the size of this data set (i.e. lines of file) is N. I want to randomly draw m lines from this data file. Therefore, the output should be two files, one is the file including these m lines of data, and the other one includes N-m lines of data.
Is there a way to do that using a Linux command?
Hi All,
I have input file which is pipe delimited
A | 1
B | 2
c | 3
I need output of displaying total number of lines in a file as last column.
A | 1 | 3-----total number of linesin file.
B | 2 | 3
c | 3 | 3
I try to count number of lines of a data.txt file and then if number of lines is greater than 1 then email me the file.
I could not find what is wrong with my code, hope you can point out the mistake i made
Code:
#!
Hi all,
I have a tab-delimited text file of size 10Mb. I am trying to count the number of lines using,
Code:
grep -c . sample.txt
or
Code:
wc -l < sample.txt
or
Code:
awk 'END {print NR}' sample.txt
All these commands shows the count as 1, which means they are reading only the first header line of the file.
I have a file like below . The good pages must have 3 conditions :
The pages that containing page total only must have 50 lines.
The pages that containing customer total only must have 53 lines.
The last page of Customer Total should be the last page.
How can I accomplish separating good pages from bad pages using GAWK ?
I have file A.txt
File A
Code:
1,Hi,234
2,Hello,345
1,Kal,980,
9,KJ,098
2,de,098
..
...
I have more then 600 lines...
I want separate the files as per 150 line.
Code:
First 150 lines ----File A1.xtx
Second 150 lines ---File A2.txt
Third 150 lines----File A3.txt.
...
Rest of ----File N.txt.
..
Thanks
Hi.I need to do a script that can receive any number of parameters which are file names and return the number of lines every file has.the output should be like that "The file nameoffile.txt has 5 lines".From what i have done my output is like "The file nameoffile.txt has 5 nameoffiletxt lines".how can I do the output without printing the name of file after the number of lines.
Hi,
I need to make a script to extract the number that are not in a file.
Example:
I have file-A that has 100000 (70000-799999) numbers. And a file-B with number that already are in the system.
I have a text file which is having 30000 lines in it. I have to create a xml file for each 10000 lines until all the lines in the text files are written. Also please help how can i get number of lines in the text file in a shell variable?