Split a file into multiple files based on line numbers and first column value
Hi All
I have one query,say i have a requirement like the below code should be
move to diffent files whose maximum lines can be of 10 lines.Say in the below example,it consist of 14 lines.
This should be moved logically using the data in the fisrt coloumn to file1 and file 2.The data of first coloum should
not be present in both files(file 1 and file2 for a value i.e in the below example 102103 should be in on file only.In the below
example 102103 has 8 lines and i cannot place all in file 1 bcos it will exceed the maximum lines of file(10) .
Input
Output should be like below:
File 1:
File 2
Thanks in advance.
Dear All,
I would like to split a file of the following format into multiple files based on the number in the 6th column (numbers 1, 2, 3...):
ATOM 1 N GLY A 1 -3.198 27.537 -5.958 1.00 0.00 N
ATOM 2 CA GLY A 1 -2.199 28.399 -6.617 1.00 0.00 ... (3 Replies)
Hello, I am using awk to split a file into multiple files using command:
nawk '{
if ( $1 == "<process" )
{
n=split($2, arr, "\"");
file=arr
}
print > file }' processes.xml
<process name="Process1.process">
... (3 Replies)
Hi,
I've one requirement. I have to split one comma delimited file into multiple files based on one of the column values.
How can I achieve this Unix
Here is the sample data. In this case I have split the files based on date column(c4)
Input file
c1,c2,c3,c4,c5... (1 Reply)
Good day all
I need some helps,
say that I have data like below, each field separated by a tab
DATE NAME ADDRESS
15/7/2012 LX a.b.c
15/7/2012 LX1 a.b.c
16/7/2012 AB a.b.c
16/7/2012 AB2 a.b.c
15/7/2012 LX2 a.b.c... (2 Replies)
So I have a space delimited file that I'd like to split into multiple files based on multiple column values.
This is what my data looks like
1bc9A02 1 10 1000 FTDLNLVQALRQFLWSFRLPGEAQKIDRMMEAFAQRYCQCNNGVFQSTDTCYVLSFAIIMLNTSLHNPNVKDKPTVERFIAMNRGINDGGDLPEELLRNLYESIKNEPFKIPELEHHHHHH
1ku1A02 1 10... (9 Replies)
I have a requirement to split a huge file to smaller text files based on first four characters which look like
ABCD
1234
DFGH
RREX
:
:
:
:
:
0000
Each of these records are OF EQUAL bytes with a different internal layout based on the above first digit identifier..
Any help to start... (5 Replies)
Dear All,
I have to solve the following problems with multiple tab-separated text file but I don't know how. Any help would be greatly appreciated. I have access to Linux mint (but not as a professional).
I have multiple tab-delimited files with the following structure:
file1:
1 44
2 ... (5 Replies)
Hi All,
I have the sales_data.csv file in the directory as below.
SDDCCR; SOM ; MD6546474777 ;05-JAN-16
ABC ; KIRAN ; CB789 ;04-JAN-16
ABC ; RAMANA; KS566767477747 ;06-JAN-16
ABC ; KAMESH; A33535335 ;04-JAN-16
SDDCCR; DINESH; GD6674474747 ;08-JAN-16... (4 Replies)
I am using below code to split files based on blank lines but it does not work.
awk 'BEGIN{i=0}{RS="";}{x="F"++i;}{print > x;}'
Your help would be highly appreciated
find attachment of sample.txt file (2 Replies)
Discussion started by: imranrasheedamu
2 Replies
LEARN ABOUT NETBSD
larn
LARN(6) BSD Games Manual LARN(6)NAME
larn -- exploring the caverns of Larn
SYNOPSIS
larn [-chilns] [-o optsfile] [-##] [++]
DESCRIPTION
larn is a fantasy games in which your child has contracted a strange disease, and none of your home remedies seem to have any effect. You
set out to find a remedy in a limited amount of time, and to collect gold along the way of course!
The options are:
-c Clear the high scores file.
-h Show the command line options.
-i Show the high scores, including inventory data.
-l Show the log of all games.
-n Suppress the welcome message and start the game immediately.
-o Read the specified options file instead of ~/.larnopts.
-s Show the high scores.
-## Set the difficulty (hardness) level.
++ Restore game from the checkpoint (auto-save) file.
COMMANDS
These are the movement commands:
h move to the left H run left . stay here
j move down J run down Z teleport yourself
k move up K run up c cast a spell
l move to the right L run right r read a scroll
y move northwest Y run northwest q quaff a potion
u move northeast U run northeast W wear armor
b move southwest B run southwest T take off armor
n move southeast N run southeast w wield a weapon
^ identify a trap g give present pack weight P give tax status
d drop an item i inventory your pockets Q quit the game
v print program version S save the game D list all items found
? this help screen A create diagnostic file e eat something
(wizards only)
OPTIONS FILE
The file ~/.larnopts may be used to set a few options for larn. A sequence of words terminated by whitespace is used to specify options.
Word Meaning
bold-objects Select bold display of objects.
inverse-objects Select inverse video display of objects.
no-introduction Do not display intro message.
enable-checkpointing Turn on periodic checkpointing.
no-beep Disable beeping of the terminal.
male Choose your sex to be a man.
female Choose your sex to be a woman.
name: ``your name'' Choose your playing name.
monster: ``monst name'' Choose a name for a monster.
savefile: ``save-file-name'' Define what the savegame filename will be.
Your name and monster names must be enclosed in double quotation marks and may be up to 34 characters long. Longer names are truncated.
Anything enclosed in quotation marks is considered one word, and must be separated from other words by whitespace.
SPECIAL NOTES
When dropping gold, if you type '*' as your amount, all your gold gets dropped. In general, typing in '*' means all of what you are inter-
ested in. This is true when visiting the bank, or when contributing at altars.
You can get out of the store, trading post, school, or home by hitting <esc>.
When casting a spell, if you need a list of spells you can cast, type D as the first letter of your spell. The available list of spells will
be shown, after which you may enter the spell code. This only works on the 1st letter of the spell you are casting.
FILES
/var/games/larn.scores Score file.
~/.larnopts Options file.
AUTHORS
Noah Morgan
BSD April 23, 2010 BSD