Programming :: Show The Output Of These Fields In A Certain Way That Every Record Is Numbered?

Mar 25, 2010

i am reading a database flat file with the "awk" command which has 4 fields separated by colon ":" .I want to show the output of these fields in a certain way that every record is numbered e.g

1.some text
2.some text

Is there a way to do this?

View 14 Replies


ADVERTISEMENT

Programming :: List 4 Names From Users List And Output Them To Fbusers In Numbered Ascending Order?

Feb 2, 2010

How would I list 4 users ID numbered 10, 11, 12 and 13 from my users list and output them to a file busers where their names are numbered by ascending order? How would I accomplish that on a one line command?

View 4 Replies View Related

Ubuntu :: Formatted Output To Terminal - Fields Need Updating

Jan 25, 2010

I'm writing a couple of programs in C and need to do something to formatting the output. I'm after producing something like a old mainframe screen or early micro where you could PRINT (x,y) to put something on the terminal where you want it. Learning GTK or such is not an option due to time constraints, and some fields need updating frequently during processing, so letting the terminal scroll is going to drive the operator up the wall pretty quickly.

View 2 Replies View Related

Programming :: Show The Output Of Shell Command Into A Textbox, Ex Ps -efc Command?

Oct 20, 2010

I am using gtk to program GUI. How can I show the output of shell command into a textbox, ex ps -efc command ?

View 3 Replies View Related

Programming :: How To Remove Last Two Fields

Apr 27, 2010

I have a filename file-name-here-1.2.3-i486-2.tar I would like to know how to remove the last two fields leaving only: file-name-here-1.2.3

I can use:

x=file-name-here-1.2.3-i486-2.tar
echo ${a%-*}

to remove the last field (after -) but how do i remove the last two in one fell swoop?

View 2 Replies View Related

Programming :: Awk: Swap Fields Given A Condition?

Oct 8, 2010

I have a file records as follows:

Jane pepe@pepe.biz
john@pepe.net John
Joe joe@willxyz.org

How can I get that always first field be given name and second one be the mail address?

I've tried

Code:

awk '$1 ~ /@/ { a=$1 ; $1=$2; $2=a; print }' file

But that doesn't worked

View 5 Replies View Related

Programming :: Finding Common Entries In Fields Using Awk?

May 31, 2010

I want to extract all the common entries in the given 3 columns(fields) in the file using awk::can somebody tell me how it can be done in awk...the file is::

NC_000858.pttNC_000858.fnaNC_001403.rnt
NC_001362.pttNC_001436.fnaNC_001407.rnt
NC_001364.pttNC_001503.fnaNC_001488.rnt

[code]....

View 8 Replies View Related

Programming :: Compare Files With Fields Separated With ':'?

Jul 16, 2011

Dear expertsI have files like

ABD : 5869 events, relative ratio : 1.173800E-01 , sum of ratios : 1.173800E-01
VBD : 12147 events, relative ratio : 2.429400E-01 , sum of ratios : 3.603200E-01
SDF : 17000 events, relative ratio : 3.400000E-01 , sum of ratios : 7.003200E-01

[code]....

View 3 Replies View Related

Programming :: Limit In Number Of Fields That Awk Can Handle

Mar 2, 2011

I have a file with 200 000 lines and I want to append the fields of each line based on matching first field. The resulting file should have 70 000 columns but has "only" 18 000. The command I'm using is working perfectly with a smaller file, wich lead to 14 000 columns. Could there be a limit in number of fields that awk can handle ? Here's my awk command :

Code:

awk -F, 'END { for (k in _) print _[k] } { _[$1] = $1 in _ ? _[$1] FS $4 : $1","$4 } ' file > out

Also, this command writes ^M (windows line break) after each columns. Removing them is easy but where do they come from ? Working on Ubuntu 10.10

View 4 Replies View Related

Programming :: Split Fields In A Perl Array?

Dec 16, 2010

I have an array called @logons. How can I step thru the array and split the fields? This is what I have so far, but doesnt work. I got the feeling I the split statement syntax is incorrect.

Code:

print @logons;
foreach my $logons(@logons){
($userid, $ip) = split(',',$logons);

[code]....

Update: Appears the data in @logons has a column header from the mysql query which I used to populate it with. So that code which I was testing does indeed work.

View 10 Replies View Related

Programming :: Bash - Generating A Table With Aligned Fields

Apr 9, 2009

I want to write a function which calculates the space needed between fields, to generate a table with aligned fields, like when you type "ls -l", the operating system generates a table with beautifully aligned fields. I've got this code so far:

Code:

for line in $(cat tmpSearch)
do
line=`echo $line | tr ":" " "`

[code]....

View 2 Replies View Related

Programming :: While Receiving Can Use Functions Like Strchr() To Differentiate These Fields For Sockets?

Apr 15, 2009

constructing a protocol where in it involves sending and receiving different files, so sending data over consists of file name, size of the file and content of the file, so while receiving can i use functions like strchr() to differentiate these fields for sockets? so to allocate memory for file to save i need to have its size.

View 3 Replies View Related

Programming :: Updating A Sequence Of Datetimes In Fields With Unique Contrains

Mar 14, 2010

I am faced with the following problem; I need to update all fields of type datetime without ... with the following sort data:01-01-2010 12:10:30.256 - this is just an example.these fields are restricted with a unique constrained. My question is how can I generate the above sort data, especially the last three numbers with leading point. After that how can I update a table with existing data with this newly generated data so that the fields really do carry unique data.As you probably can read out of my question, I read through the help in pgAdmin and came as far as generating date, maybe datetime but not the .123 number. And a little insert script I found in the help, that I modified as UPDATE resulted in updating only the last generated data in all required fields.

View 7 Replies View Related

Ubuntu Multimedia :: Record All Audio Output?

Jul 14, 2010

Have you ever wanted to record a sound heard from your computer or website? If yes outRec is perfect for you. This simple but powerful application let you to record your sound card audio output easily in a few steps and save it in different kinds of formats like wav, mp3 or ogg.

Download from [URL]

To get it work you need to install the dependencies with:

Code:
sudo apt-get install sox gambas2-runtime lame mplayer libnotify-bin libmp3lame0 gambas2-gb-form gambas2-gb-desktop gambas2-gb-gui libtwolame0

View 1 Replies View Related

Ubuntu :: Record Text To Speech Output From Festival

Mar 13, 2010

How can I record text to speech output from festival to an audio file like mp3 or ogg?

My guess would be to pipe it to a command line recorder

View 1 Replies View Related

Ubuntu Multimedia :: Pulseaudio Record From Input - Output ?

Sep 8, 2010

What i am trying to acomplish is this

Code:

I have found a few guides that were to accomplish this, but they seem outdated as options they call for are not available to me.

View 4 Replies View Related

OpenSUSE Multimedia :: Cannot Properly Record Sound Card Output

Apr 8, 2010

A few days ago I setup a pc. It contains an "Intel ICH5" sound card. Before I begin posting all the configuration stuff I've tried so far what the standard procedures are to set it all up for recording the sound card output (with Audacity)?

On my older computer it all worked fine but now I only get silent recordings. However sometimes (when I played on the controls the right way...) I get recordings where you can (amoung some noise) recognize the stuff I actually wanted to record very low... Apart from Audacity I've also tried

Code:
arecord -vv -fdat audio.wav
which didn't work either. That's why I think the problem is not related to Audacity but to the system.

Is the combination of OpenSuse 11.2 + ALSA + Intel ICH5 commonly known to cause such trouble?

View 8 Replies View Related

Ubuntu Multimedia :: Record Live Show (video And Audio) Using Vlc For Website?

Jun 13, 2010

I am wondering how i would do this using VLC (i want both video and audio to be recored),
i see this RTSP Protocol people use but no idea how to use this for a website thats going to have a live show on.

By the way the thing i want to record will be here http://e3.nintendo.com.

Would it be rtsp://e3.nintendo.com?
hopefully thats a link that can be recorded...right?

the reason i want to record this is because i got a test i have to take... i gotta stay for like 2 hours.

View 6 Replies View Related

Ubuntu Multimedia :: Record Audio Card Output And Mic Input Gtk-recordmydesktop?

Feb 13, 2011

I am currently trying to start doing some screen casting and having a problem with audio recording in gtk-recordmydesktop. The problem is that I need to record both; my computers audio card output, and my mic input at the same time. As of now I am able to record one or the other.

View 4 Replies View Related

Programming :: Formatting Fields And Text Being Displayed From Text File?

Feb 9, 2011

I want to display the contents of a particular log file (simple text file, I mean in Linux). But there is a problem: The contents need to be organized in a fixed format. Have a look at this log file:

sampleLog.txt

Code:

User Name: XYZ
Reported Problems Description: Blah! Blah! Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah!

[code]....

So, while displaying the contents of above file on a web page, I want to format the field names found in the log file: User Name:, Reported Problems Description:, and Remarks:. These fields may contain a variable length of text and no specific line number is assumed for them to appear on.

The desired output should look like this:

User Name: XYZ
Reported Problems Description: Blah! Blah! Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah!

[code]....

Well, what I am trying to do may sound wierd to some of you. The filed "Reported Problems Description:" can possible contain text which embeds colon (.

View 15 Replies View Related

General :: Grep - Output Show Only Right Of?

May 17, 2010

I forgot a lot of my command line. I am doing cat file | grep "error" and i would like it to show everything to the right of G:/ including G:/ if possible. I figure its an awk command but i dont know what. I tried awk '{print $8+}' but + does not work like i hoped and guessed.

View 2 Replies View Related

General :: Limit The Output To Show Only First 2 Files?

Mar 30, 2011

Let's say I have a command

ls -Bgclt /somwhere/in/the/past

How do I limit the output to show me only first 2 files? (except for having only 2 files in that directory)

View 2 Replies View Related

General :: Show The Output Of Several Vi Files In A Single File?

Jan 3, 2011

i have 10 vi files . these files contain some system related information. i need to combine the output of all these files into a single file. the final file should contain contents of all these 10 files and the output should be in a tabular format.

is there any command in vi that i can use to create a table ?

View 9 Replies View Related

General :: Xfce4-panel - Show Output Of Command?

Feb 15, 2011

Is it possible to show the output of a command in xfce4-panel? Like you would do with Conky.The Xfce battery monitor consistently uses a bit of my CPU so I wish to run "acpi" (and work out a clever way to just show the percentage) every 5 or 10 minutes in the panel.

View 5 Replies View Related

General :: Show Output On Terminal And Save To A File At The Same Time?

Jul 1, 2010

I am using:

user@unknown:~$ sudo command -option > log

to save the results of "command" to the file "log", but I'd like to also get the result on the terminal, is this possible?

I am using ubuntu 10.04 lts.

View 3 Replies View Related

General :: Ping To Show The Requests 'time Out' Instead Of Omitting The Output?

Apr 12, 2011

How can I make the Linux ping to show the requests 'time out' instead of omitting the output?

Just like the Windows version of ping.

View 3 Replies View Related

Ubuntu :: How To Record The Radio Show From A Radio

Dec 8, 2010

record my radio show from a radio I have plugged into my iMac. That's right. For now, I am dual booting on my iMac until I can afford to buy a dedicated PC desktop just for Ubuntu.

I can't believe that there seems to be no way for me to record my shows from my radio. Works fine when I boot into the Mac side and even when I use Ubuntu using VMware Fusion. When I boot into Ubuntu directly, Audio In in the Sound preferences doesn't seem to work. No audio coming through when I try to record from the radio.

View 2 Replies View Related

Programming :: Awk: How To Keep The Format Of The Record

Apr 5, 2010

In /etc/fstab, I have a record:LABEL=/< >/< >ext3< >default,nolog< >1 1 represent a tab between 2 fieldsI just want to remove "nolog" in the 4th field (only): gsub(/nolog/,"",$4)The function work ok but it returns a record:LABEL=/ / ext3 default 1 1I know the problem is OFS=" ", but how can I keep the format of the record? (the same number of tabs, spaces).

View 5 Replies View Related

General :: Cp 'limit' Numbered Backups?

Mar 17, 2011

I currently use cp to backup data. I prefer it over rsync. I use the -b switch to make a backup of data and recently found you can use --backup=t to create numbered backups.Using --backup=t means that I could end up having 100 versions of a file if I change it 100 times. With the -b switch I will only ever have 2 versions. Is it possible to limit the numbered backups to 5 for example? So I would only ever have 5 versions?

View 2 Replies View Related

Programming :: Record The Screen To Ogg With X11 And Without Xvidcap?

Jan 30, 2011

Xorg is so cool. Anyhow is there some solutions to make video of the screen using only the regular tools of xorg or import or scrot even?

View 1 Replies View Related







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