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


ADVERTISEMENT

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

Software :: Escape Single Quotes In Sed For Multi Line Pattern?

Jul 18, 2011

I have some code written in VHDL that looks as follows:

Code:
foo = "bar";
foo <= 'bar',

[code]...

View 1 Replies View Related

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 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

Fedora :: Run Python3 Scripts From Command Line And Call Up Python 2.6.2 Idle With The Command Idle From Command Line?

May 29, 2010

i've gotten my fedora 12 to the point where i can run python3 scripts from command line and can call up python 2.6.2 idle with the command 'idle' from command line. what command will call up python3 (3.1.2 to be exact) idle?

View 5 Replies View Related

General :: Command Line Way To View A Line Of A File With Context?

Feb 24, 2011

I'd like show a certain line or lines of a file with context, kind of like a unified diff, on the command line in Linux:

$ (something) -l 154 stuff.py
150: def foo(bar):
151: """

[code]....

View 5 Replies View Related

General :: Printing Command Line History Without Line Numbers?

Aug 22, 2011

How can I print Linux command line history without including the line numbers? I want to send it all to a text file like this:history >> history.txt

View 1 Replies View Related

Programming :: Get Data From Multi Lined Text File Using Awk / Sed Or Perl - Grep And Cut Not Upto Par?

Jul 1, 2010

I need a loop that pulls out the user name into a variable and then pulls out the LastUpdate field into another variable so I can then perform a comparison against the last update field. Requirements are AIX tools including AWK, SED and Perl I am writing a script to check AIX users password expiration dates and if they are within the alerting period (ie. 7 days etc) it will email the user. I will release the full script into the public domain once completed. The text file I want to parse is formatted like:

Code:

colettel:
password = XSON0m4SdIQDw
lastupdate = 1260829398
andrewwa:

[code].....

View 4 Replies View Related

Programming :: Printf: Giving "001 002 003 004 006.... 150" In A Single Line Dash Command

Jan 15, 2011

I am intended to simply make printf give "001 002 003 004 006.... 150" but with the single command line of SH (dash) ... not easy ...

Code:

tucholsky:~$ seq 1 1 150 | sed 's/([0-9]+).*/1/g' | tr '
' ' '
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48

[code]...

For the geeks, which distro/version is it, based on the code above

View 6 Replies View Related

Programming :: Copy And Replacing Specific Line From File1 To File2 Line By Line

Mar 22, 2011

I have two files, file1.traj and file2.traj. Both these files contain identical data and the data are arranged in same format in them. The first line of both files is a comment.

At line 7843 of both files there is a cartesian coordinate X, Y and Z ( three digits ). And at line 15685 there is another three digits. The number of lines in between two cartesian coordinates are 7841. And there are few hundreds of thousands of lines in a file.

What I need to do is copy the X Y Z coordinate (three digits) from file1.traj at line 7843 and paste into file2.traj at the same line number as in file1.traj. The next line will be 15685 from file1.traj and replace at line 15685 at file2.traj. And I dont want other lines (data) in file2.traj get altered. This sequence shall be going on until the end of the file. Means copy and substitude the selected lines from file1.traj into file2.traj.

I tried to use paste command but I cant do for specified line alone.

Here i showed the data format in the file. I used the line number for clarity purpose.

Code:

View 10 Replies View Related

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 View Related

Programming :: Access A File Line By Line, And Check The Length Of Each Line.

Feb 13, 2011

I want to access a file, and check the length of every line.After, i want to check and replace all lines with length over 10 characters, with a message.Does anyone have a clue on that?

View 1 Replies View Related

Programming :: Compare Two Files Line By Line And Print The Line Which Is Same?

May 30, 2011

I am trying to write a program in C which compares two files and prints the line that is equal.

Here file1.txt has

and file2.txt has

Note: file2.txt consist of only a single string where as file2.txt has multiple lines. Actually im comparing two files with md5sum values.

Here is the code but it compares only first line of files..but it should compare the whole file1..and sorry iam a beginner in C can any1 sujest some modification to this code so that..it can compare file2 with entire file1

Quote:

View 9 Replies View Related

Programming :: Insert Line Using Sed Or Awk At Line Using Line Number As Variable

Jul 25, 2011

I want to insert a line at a particular line number using sed or awk. where line number is not fixed and is in form of variable.

I want to use variable in sed or awk command.I tried something like below, but no luck.

View 7 Replies View Related

Ubuntu :: Empathy - Multi-line Pastes Don't Appear In Msn Chat

May 22, 2010

When an msn contact pastes a multiple line piece of text(couple of lines or more) into their client and sends it, the message fails to display in my empathy chat window. If the window is not focused there is a notification for the message, consisting of '...' in the notification bubble, but no text appears in the window. The same thing happens(or rather doesn't happen) if the window is focused but without the notification.

However, if I look in the chat history for that conversation the pasted text shows up where it should. I noticed this 'problem' in Empathy in karmic previously, so I'm not sure whether it is a bug or a feature, which is why I ask here rather than making a bug report. Using Lucid updated earlier today. This doesn't happen in pidgin, and it's quite annoying, but I would like to keep using empathy.

View 1 Replies View Related

General :: Process Multi-line Regular Expressions?

Feb 23, 2010

How to make tools like sed operate on the whole file, instead of line-by-line?

View 14 Replies View Related

Programming :: Multi-line Find - Replace With GnuWin32 Sed?

Apr 26, 2009

I would like to have a script that will do a search in an XML file for a specific block of XML code and replace it with a different block of XML code using the Windows build of GNU Sed 4.1.5.

Here's the text I want to find:

Code:

And here's what I want to replace it with:

Code:

There is however a lot of stuff in there that would mess up sed, and the one example from the sed FAQ (from the Sourceforge site) that looked promising and easy enough to figure out (4.23.3. Try to use a block of "literal strings") fails with this error message: sed: file blockrep.sed line 18: unterminated `s' command

Anyone got any ideas, or even an alternate program that can do this? (Preferably one that I can automate.)

View 4 Replies View Related

Ubuntu :: 11.4 Classic - Move Down A Single Line With The New Scrollbars?

May 6, 2011

I would have thought the arrows at the edges of the new scrollbar move up/down by line and the grey pads of space between the separator would move by pg/up or down. All seems correct with the exception of the arrows to move up/down.I look around through code, manuals and pdfs and such often and used to the use arrow pointers at the top and bottom of the old scrollbar style to move down or up by line all with the mouse....now with the new scroll bar I find myself struggling all the time for this type of simple operation as it seems the arrows in the overlay scrollbar perform a pgDown/pgUp operation not a move down/up line....anyone know how?

PS - If anyone is curious on how to best to test this on your own, a simple test I did was to create a text file of line numbers with the following command:

seq 1 200 > numbers.txt

View 4 Replies View Related

Ubuntu Servers :: NFS - Exporting Multiple FS With Single Line?

Jul 26, 2011

I'm using my home server to netboot into live CDs. To summarize that article, netbooting a liveCD system involves passing an NFS host:/path in kernel's command line, which is subsequently mounted as /cdrom on the live system. The article mentions copying the contents of the iso image to a place on the hard drive, but I see no reason for this, since the contents need to be read-only anyway, which is easy to achieve by mounting the iso through a loop device:

Code:

# mount
...
/dev/loop0 on /mnt/kubuntu-lucid-amd64 type iso9660 (ro)
/dev/loop1 on /mnt/kubuntu-natty-amd64 type iso9660 (ro)

[code]....

Now, I am using NFS to mount a regular (rw, HDD) directory which I use as a network drive and I can mount any subdirectory and still access all the files within, ie. when I export /data on the server, I can still mount /data/downloads on the client:

Code:

server:# exportfs
/data 192.168.1.4/32
client:$ sudo mount -t nfs 192.168.1.1:/data/downloads /mnt/netshare

[code]....

Is it possible to export just /mnt and be able to mount any/all of the subdirectories? NFS doesn't like going across multiple file systems:

Code:

server:# ls -al /mnt/kubuntu-natty-i386/
total 3532
dr-xr-xr-x 11 root root 4096 2011-04-27 11:29 .
drwxr-xr-x 7 root root 4096 2011-07-25 21:46 ..

[code].....

When I try to export just /mnt and mount /mnt/kubuntu-natty-i386 on the client, the mount succeeds but the mounted directory is empty.

View 1 Replies View Related

Programming :: Updating A Single Line In A Text File?

Dec 30, 2010

I have a text file called namelist.wps. In this file there is a line that reads:Code: start_date = '2010-12-26_12:00:00', '2010-12-26_12:00:00', I have to automatically update the year, month, and day of month. I set values for the year, month, and day of month using the following code in a c-shell script:Code: set y1 = `date +%Y`set m1 = `date +%m`set d1 = `date +%d` After I do this, how do I update year, month, and day of month, without changing any of the other lines in the namelist.wps file?

View 2 Replies View Related

Programming :: Programing - Reading File Line By Line Then Char By Char In Each Line

May 29, 2010

I've never programed shell scripting.

Code goes like so:

I simply want to read a file "data.txt" line by line Then char by char and add them into a result var. The file is supossed to always contain numeric values

View 8 Replies View Related

Ubuntu :: Update A Single Line Of An Output In A Bash Script?

Nov 1, 2010

This is more of a bash or scripting How do you update a single line of an output in a bash script. I have had to do the:

[Code]..

Is there a way to clear only a single line of output? my goal is to mimic a single line animation, much like the '=>' '==>' ' ===>' we have all seen in other programs.

View 3 Replies View Related

General :: List Output In Single Line (space Separated)?

Feb 1, 2011

got a situation where if i process a command i get a numeric output something like below:

for example:

# cat example.txt
856589
856470
987866
656658
876897

now i want to see this output in single line like below:

856589 856470 987866 656658 876897

how do i get this?

View 10 Replies View Related

Programming :: Take A Single Line Of Input From User In Shell Script?

Mar 10, 2011

How do i take a single line of input from the user in a shell script?

View 3 Replies View Related

General :: Create A Single Line Of Output From Multiple Variable Lines Of Input

Feb 3, 2010

I need to create a single line of output from multiple and variable lines of input in a Linux bash shell script.

My input file looks like this:

Where there may be any number of umsecondaryphonenumber lines; if there is not a umsecondaryphonenumber line for a telephonenumber, I don't want to write any output.

So, the output file should look like:

The script I have so far is:

My question is - how do print each of the elements of an array in one record - i.e. what do I put in place of howdoiprintarray?

View 2 Replies View Related

Programming :: Effect Of Using Eval To Execute A Command As Opposed To Writing It On The Command-line?

Jun 18, 2010

Code: cmd='date | wc'

$cmd If this script is executed, an error is generated. The reason written was that "The execution fails because the pipe is not expanded and is passed to date as an argument".What is meant by expansion of pipe. When we execute date | wc on the command line, it goes fine.then | is not treated as an argument. Why?

View 4 Replies View Related

General :: Ubuntu 10.10 And Command Line Scripts - Error - Android: Command Not Found

Mar 26, 2011

I know my way around MS Windows much better, but I just don't feel right trying to program something for Android on a Microsoft operating system. I am interested in Android programming so I followed the instructions on [URL] to install the environment on my computer...

I just installed the JDK, SDK, Eclipse successfully (or I assume):

* When I get to Step 4 where I'm supposed to run 'android' it will not run. I get the error message "android: command not found" (I am definitely in the right directory).

** When I double-click it in nautilus, it opens up in gedit. I can set the permissions in nautilus (through the properties - Allow executing file as a program) and get it to work,

My system:

Intel i7
Ubuntu 10.10 Maverick Meerkat
android-sdk-linux-x86
eclipse 3.6.2

View 5 Replies View Related

General :: Access The Dbxml From The Command Line And It Returns Command Not Found?

Apr 30, 2011

I installed the Berkeley DB on the Ubuntu server and tried to access the dbxml from the command line and it returns command not found

path/to/dir/dbxml-2.5.16/install/bin$dbxml
-bash" dbxml: command not found

Can someone point me in the right direction

View 1 Replies View Related

Software :: Command Line: Chown Command Recursively On Invisible Directories?

Oct 25, 2010

I tried

Code:

chown -R owner:group *

which does not work on the invisible directories (why?). When I used ".*" as wildcard it changed all (visible) files including the parent directory (the one I was currently working in which is the "dot") . I can change the invisible directories owner and group using dophin but how is it done from the command line?

View 9 Replies View Related







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