General :: Extract SampleID From Split Line?

Oct 12, 2010

I have a text file of n-number of tab-delimited lines ("INPUT") which I would like to parse line-by-line to a text output file depending on the SampleID of the line. These lines contain a unique SampleID and each subject has several lines of data.

[code]....

I also have a text file of relevant SampleID ("INPUT2"). The basic idea is that I read a line from INPUT, split the tab-delimited line, extract the SampleID from the split line, compare the SampleID of this line to my list of relevant SampleIDs. If there is a match, then print the line from INPUT to OUTPUT, then move on to the next line of INPUT. Alternatively, if there is no match, then move on to the next line in INPUT. I tried to script this (extreme newbie at perl right now) and failed miserably, but here is what I have at the moment:

[code]...

View 4 Replies


ADVERTISEMENT

General :: VIM Command To Split A Line Into 2?

Apr 27, 2010

How can I split a line in vim into 2. example :

original line :

welcome to linux questions

after splitting :

welcome to
linux questions

Is there a single key strike through which i can do it ? like going to the word "to" and striking that key will put rest of the words in new line. ( i want to do it in normal mode , not in the usual insert mode where it obviously can be done by typing <Enter> )

View 6 Replies View Related

Ubuntu :: How To Extract Split Compressed Files

Jun 24, 2010

im trying to reconstruct / extract a file that was too large to fit onto a floppy, used 7zip to create and split the file into multiple parts in tar.bzip format. this was done in windows. Then moved all the parts of the file to tiny linux on a really old laptop. no cd drive, no usb or network. so have to rely on floppy drive. i do know that reconstruction while extracting using commands is possible. but not working.tried tar -xMf file.tar.001 but nothing.

View 2 Replies View Related

Software :: Use Command Line To Split A Single-lined XML Into A Multi-line XML?

Dec 9, 2010

I have a many text files that have XML tags all shoved into 1 line. I want to create a new file that splits each XML tag onto a new line. code...

View 3 Replies View Related

General :: Script To Extract Appropriate Line From Website Using Links

Oct 26, 2010

I need to write a script called '~/get_birthrate' which when invoked with a two letter country abbreviation(i.e, au,ch,ni), extracts the appropriate line which contains the information about the country's birth rate from the [URL] (where "ca.html" should be replaced with the appropriate two letter abbreviation). The output should look like:

$ get_birthrate au
8.69 births/1,000 population (2007 est.)
$ get_birthrate ch
13.45 births/1,000 population (2007 est.)
$ get_birthrate ni
40.2 births/1,000 population (2007 est.)

View 4 Replies View Related

Ubuntu :: Extract The 7th Line Below C-FM And Every Third Line After That?

Feb 1, 2011

I need to extract the 7th line below C-FM and every third line after that. How can I do it? I've tried using grep but I get all the lines in between. An example of the text I am working with is shown below.

C-FM RADIAL POINT-WISE DATA
(P,K-INF,BU)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

[code]....

View 2 Replies View Related

Ubuntu Multimedia :: Split Wav Files From The Command Line?

Apr 2, 2011

how to split wav files from the command line?

View 4 Replies View Related

Programming :: Split Multi Line Record Into Multiple Files With Awk?

Nov 11, 2009

I have a large file 'NS0923.csv' with data like the following. There are two records in this multi-record sample.

Code:

E60898,4578910,03/06/09,BEN BOYD RD,61,82,,,127,3,,52000.3046.001,3155,4.00,,PLT,1356,1.00,05/06/09,Y,Y,0551
,,,,,,,,,,,,4057,1.00,CLEAN CAR SHARE SIGN,LAB,0551,1.00,,,,

[code]....

2. I still have to create a file 'transaction.csv' that should retrieve data from $13 - $15 with the identifying column $1. Required output:

Code:

E60898,4057,1.00,CLEAN CAR SHARE SIGN

3. And finally another file 'quantity.csv'. Retrieving data from $16 - $18 with identifier $1. Required output:

Code:

E60898,PLT,1356,1.00
E60898,LAB,0551,1.00
E60898,LAB,3065,1.00

[code]....

View 10 Replies View Related

Fedora :: How To Extract Line From Text File

Aug 24, 2010

I'm trying to figure this error message out. This little script is supposed to tweet my laptop's IP address, as a cron job, I'm hopeful that it would do so even if it's stolen. This is a variant of one that works, but this doesn't, and I can't see a difference in the curl line of either one.

Code:
#!/bin/bash
user="xxxxxx@xxxxxxxxx"
pass="xxxxxxxxxxx"
wget [URL]
TWEET=`sed -n 1p index.html`
curl --basic --user "$user:$pass" --data-ascii "status=$TWEET" "[URL]"
rm -f index.html
exit
This is the error message.

Code:
curl: (6) Could not resolve host: status=66.183.103.67; Cannot allocate memory
{"request":"/statuses/update.json","error":"Client must provide a 'status' parameter with a value."}
Why does curl think the status is the URL?

View 7 Replies View Related

Programming :: Awk To Extract Phrase Between Two Words On A Line?

May 25, 2010

im trying to find a way to extract the phrase between the words Connection and is (ie the underlined words below). Can we use awk to do this? How? Is it the best command to use?

Code:

[06:25:00][i] Connection at Plant A is live
[06:25:00][i] Connection at Building_C is not live
[07:25:00][i] Connection at Terminal D is down

View 12 Replies View Related

Programming :: Extract Via Command Line The Latitude And Longitude?

Aug 10, 2010

I trying to extract via command line the latitude and longitude with this command Code: curl -s [URL]

View 4 Replies View Related

Software :: Split A File, Without Using 'split'?

May 20, 2011

Im in a unique situation where a box has a 400G file, on FreeBSD, without thesplit' utility available

View 11 Replies View Related

General :: How To Split Tar In Two Files

Feb 2, 2010

I'm trying to upload my tar'ed site to server but I have upload limit. My ftp program extracts tar after uploading it. How do I split this one tar into two so I could upload one tar and let it extract itself, and then upload second one and let it extract itself too?

View 1 Replies View Related

General :: Why Does AWK Split Lines Into Two

Aug 5, 2010

when I run the following command:

awk -F, '{print $10 "," $5 "," $1 "," $3 "," $4 "}' myfile > tmpfile

tmpfile displays the lines but they are all cut off and placed on the line below at the same point.

View 1 Replies View Related

General :: How To Split A Folder

Dec 14, 2010

i have a folder of size 50 gb in my fedora 13 system. i want to split the folder into 5 pieces of size 10 gb each. how to do that? purpose is i am going to gunzip this folders seperately and going to write in dvds

when i attempted to gunzip that 50 gb folder,i got 12gb tar.gz file which is not equal to the size of a dvd. then i dont want to split that file.

View 2 Replies View Related

General :: Split A 7 GB .VOB File For DVD Authoring?

Jan 13, 2011

I have a 7 GB VOB file which I created from a DVD using ffmpeg dump to remove CSS protection (it is legal where I live to do so). Now, I want to create a DVD/.iso that will be understood by regular DVD players/appliances. How do I do it?

View 1 Replies View Related

General :: How To Split Volume Group

Oct 15, 2010

i have created two physical volumes, later added volume group to it and then created logical volume and formated the logical volume n mounted it on directory now now i wanted to split the volume group but am unable to do it.If i tries it error msg displayed as existing volume group is active and i have to inactive that volume group

View 4 Replies View Related

General :: Split Logfile For Error Logs?

Dec 30, 2009

Is there a tool already out there that will split error logs based on the virtual host they belong to? Or perhaps a somewhat simple way to write a script that can do this? I'll keep looking for a solution but I thought I'd ask in case someone here has one to offer.

View 2 Replies View Related

General :: Split Output Of A Command To Two Terminals?

Jun 27, 2011

How can I split an output of a command to two terminals? one will get stdout and the other will get stderr. The best I could do is:
On first terminal code...

This works ok but it prints the errors over and over again every time, is there any better way to redirect the errors to another terminal?

View 2 Replies View Related

General :: Split A File Into Multiple Files Using AWK?

Aug 5, 2010

I have a file with 5 columns. Column 4 contains numbers.Is it possible to split the file into multiple files using a condition for the contents of column 4 i.e if column 4 contains a value between 0-10 then print the lines to a new file called less_than_10.txt

View 1 Replies View Related

General :: Split A File Into Two - The First Being The First Two Lines And The Second The Rest?

Nov 1, 2010

I'd like to split a file into two, where the first file is the first two lines and the second is the remaining lines (third line to EOF).

View 2 Replies View Related

General :: Split A String Into Array In Bash?

Mar 17, 2011

how do I split a string into an array?In this string:"this is a story"how do I split it by the space?

View 8 Replies View Related

General :: Split A Directory Based On The Filename Prefix?

Mar 5, 2010

I have a very large directory with probably millions of small files in it. It's taking forever to run ls on the directory.

Is there an easy script that I can run to split the directory into smaller ones, based on the prefixes of the filenames. My goal is to wind up with something similar to what the Debian archives' pool directory looks like.

View 1 Replies View Related

General :: Tool To Join Videos Split Screen?

Jun 16, 2010

I am looking for a command line tool to join 2 video files, however I want the videos joined split screen frame by frame instead of one after another.

Any ideas?
Seems this is not possible with ffmpeg.

View 1 Replies View Related

General :: Split Files On Windows Compatible With System Cat?

Mar 17, 2011

I need to split up a large file on windows so I can upload it in parts to a linux machine. I'm looking to do the opposite to this hopefully with some native utilities to keep it simple.

I understand the linux side of the equation to be cat filea fileb > file

what is the simples way to split files on a windows machine which can then be joined together via cat on a linux machine?

View 1 Replies View Related

General :: Split A Video File Into Smaller Chunks?

Sep 1, 2011

Tool like Media File Segmenter for Linux

I know that one can use ffmpeg to extract a smallfile.avi from a largfile.avi. But What I am looking for is an tool/command to split a large file into several files of a given size.

View 1 Replies View Related

General :: Split Backup Created By DD Into CD Or DVD Sized Files

Dec 8, 2010

I am backing up parts of my computer with DD, and i was wondering if there was a quick way to split the files created into 4.4GB sized files that will fit onto a DVD. Anyone have any idea of how to do this?

View 6 Replies View Related

General :: Accessing Arrays Position In A Split String?

Mar 10, 2011

I've a string "this.is.a.name", and I would like to put it in an array. But, I've like to print the output of the array as:

Code:
echo ${array[0]}
echo ${array[1]}
echo ${array[2]}
echo ${array[3]}
I've tried with

[Code]....

View 4 Replies View Related

General :: Building A Regular Expression For Use In Split Function?

Apr 1, 2011

so I have a perl script that contains an array like this:@hostNames = (ABC123R:192.168.1.1, CBA321CBP:192.168.1.2, ZYX987R:192.168.1.3, etc firstelement"ABC123R:192.168.1.1":ABC123R is the hostname and 192.168.1.1 is it's IPaddress.I am trying to write a regular expression that will split the element with a '-' wherever there is a LETTER next to a NUMBER, like so:ABC-123-R:192.168.1.1I tried this expression below but am struggling with using regex for slightly complicated matching criteria:

for ($x = 0; $x < scalar(@hostNames); $x++)
{
$hostNames[$x] = split /([A-Z][0-9])/, "-"

[code]....

View 2 Replies View Related

General :: Finding A Cross-platform 'Split' Utility?

Aug 10, 2010

I need to transfer a 4Gbyte file from my Linux netbook to a friends WinXP desktop. And I'd like to it with a usb flash drive, but it can't handle a file larger than 2Gbyte. A limitation due to the underlying FAT32 filesystem. But I don't wish to reformat my usb as ext3 either.

So I need to split my 4GByte file into smaller chunks. And the 'split' utility needs to be available on both Linux and the WinXP operating systems.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved