Programming :: Sed - Series Of Files In The Format
Sep 21, 2009
I have a series of files in the format:
Which I'm trying to split using sed to have each field/value pair on on line:
So far so simple, but some of the values might have commas in them, which means they'll be split up. Is there a way to change this so that only commas not within quotes will be replaced with ? (e.g. make sed count number of " and if it finds a , after counting an odd number of " then ignore it?)
View 2 Replies
ADVERTISEMENT
Feb 2, 2010
Never mind, I figured it out myself. Firstly, the old version of BASH I'm using doesn't support
Code:
for i in {1..27}
So I had to use
Code:
for i in 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
Secondly, it was simply
Code:
#!/bin/bash
for i in 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
do
[code]....
View 2 Replies
View Related
Mar 20, 2010
what are the series of files that are called when a user make copy operation from usb mass storage to hard disk?i have reached the code of the usb mass storage in linux kernel 2.6.33 and i want the exact code the make the copy how can i do that?
View 2 Replies
View Related
Nov 12, 2010
I have a problem with the latest Fedora. Installed it cleanly on a machine with Gigabyte H55M-S2 with Intel Core i3. There seems to be no sound and I checked to see if anything is muted but is not. The manual says that the sound chip is ALC888B so this could be the first problem. Any ide how I can make it work? Here is a dump of some things on my system.
Code: [weaz ~]$ lspci | grep Audio
00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06)
[weaz ~]$ uname -a
Linux EarthwormJim 2.6.35.6-48.fc14.i686 #1 SMP Fri Oct 22 15:34:36 UTC 2010 i686 i686 i386 GNU/Linux
[code].....
View 6 Replies
View Related
May 24, 2010
i have to grep a series say 98782 from a group by series in a file ,how can i grep the series.
View 6 Replies
View Related
May 11, 2010
I recently used scalpel to recover .doc files. I only need to find just one file, but scalpel retrieved thousands and thousands of them, all titled after a sequence of numbers. If I could only search within them all for a single word I'd be able to identify the ones to check out vs. the duds immediately.
View 6 Replies
View Related
Mar 19, 2011
I am trying to generate sequence of number in the order of :
1
2
3
4
[Code]....
View 7 Replies
View Related
Oct 30, 2010
I am trying to join about 3 video file and have an audio track over the top. Nothing major and to give you an idea how basic it needs to be, I used windows movie maker in the past. I can't figure out how to do it! I had a flick through the web and some people recommended Avidmux. I installed it and i can edit one video file with no audio but if i try to incorporate a second file it just opens a new window! Has anyone got any ideas on good video editing software.
View 3 Replies
View Related
Jan 5, 2011
I am trying to create a RS232 C program that executes a series of commands down the line to a robot. Everything seems to work fine, except any sequential write to the serial port. At first I thought it was the UART's buffer being filled too fast, but even with a 50 uS delay it still throws the error.
Here is my code:
Code:
#include <termios.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/signal.h>
#include <sys/types.h>
[Code]...
View 1 Replies
View Related
Apr 29, 2011
I downloaded the ChromeOS,the file that I downloaded is in .raw format, the site tells me that I must put the .raw image in the USB pendrive using ImageWriter(the site refers to the windows version).The problem is that the ImageWriter's version for Ubuntu cannot see files in .raw format, but only in .img format.I searched the internet how to put the OS'image this format inside the USB from Ubuntu but unfortunately I haven't found anything.
View 2 Replies
View Related
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
Sep 10, 2010
I'm looking for some expert opinion on sed/script to work out the best way to transform one xml format into another however there are a few complexities around translation.
The extra complexities are to:
1) Take the start and stop time (YYYYMMDDHHMMSS) and convert to start time to unix time plus output the difference in seconds between both times.
2) Oid, tsid and sid are found by looking up an external file and finding the value against the channel. For example one of the lines in the file will be 2:806:27e2=channel1
Is there any way to write piped sed commands that can do this? If not, any ideas how the script should look like?
Input File
Code:
<programme start="20100910060000 +0100" stop="20100910061000 +0100" channel="channel1">
<title lang="en">This is the title</title>
<desc>This is the description</desc>
</programme>
Output File
Code:
<service oid="0002" tsid="0806" sid="27e2">
<event id="0">
<name lang="OFF" string="This is the title"/>
<text lang="OFF" string="This is the description"/>
<time start_time="1284098400" duration="600"/>
</event>
</service>
Look up file for oid, tsid and sid
Code:
2:806:27e2=channel1
2:756:37a3=channel2
5:4a06:42e5=channel3
View 8 Replies
View Related
May 5, 2010
What format should I go with on an external HDD to ferry large files (up to 10Gb) between various Macs, Ubuntu and Windows machines?
View 2 Replies
View Related
May 12, 2010
are there any Gui for ffmpeg because i have heard it can convert files in to mp4 format?
View 5 Replies
View Related
Feb 16, 2011
In C++ as subjected, can anyone throw me some light on how I can generic-ly format an integer value of 1 to a string value of 0001? 11 to 0011? and 111 to 0111? simply by just appending 0 in front and limiting the length of the string to 4?
View 4 Replies
View Related
Apr 3, 2011
I am trying to scan in a file which has the format of
Quote:
username:password
hello:world
right now my program says
Code:
Scanner fin = null;
try
{
fin = new Scanner(new FileReader("proj1/passwd.txt"));
[Code]...
How do i correctly use delimiter to take in only the strings on one line?
View 1 Replies
View Related
May 5, 2010
I use Linux for my everyday work but lately I've been faced with a trouble when I send out file printouts from my browser from my Debian system to (normally) window$ systems, where they are not readable. Is there a way for me to convert the postscript files into pdf format? Most window$ users will have some sort of pdf reader installed but I am still to find one user that has Ghostscript and Ghostview installed. where can I find the TTF fonts that are shipped with every standard installation of Debian? I'm sometimes forced to print files through a windows system and because the fonts loaded in that system are not the ones I use in Debian (URW Gothic L, as an example) I end up having my official documents disfigured. If I can carry around with me a ready-to-install fonts package I can get over this obstacle.
View 3 Replies
View Related
Nov 7, 2009
I am used to upload files to the web and as I have very large divirlos in equal installments over the windows used winrar but not here?
View 13 Replies
View Related
Nov 11, 2010
I am running my fedora box as a media server and my xbox (sorry) doesn't see mkv files and I have been looking for a while for a way to convert the mkv files to any format readable any ideas?
View 3 Replies
View Related
Feb 9, 2011
Is there an aplication/software that I can use to edit the Microsoft publisher (.pub) format files on fedora14.
View 1 Replies
View Related
Jan 13, 2010
I use a Kingston 1 GB USB to install a Acer one with ubuntu 9.04 and works perfect, the problem come wen i try to erase the USB. I can't erase the files or format the usb. How can I mount the unit with the RW options. The sistem say "the unid is label Read Only"
View 1 Replies
View Related
Apr 9, 2010
what package can I install to convert AVI files to DVD format??
View 8 Replies
View Related
Oct 30, 2010
I was trying to figure out how to generate compressed files in zip format and searched on here. The search produced a list of forum entries on the topic, but all of the instructions were on how to do it in terminal, how to download obscure programs and install them from terminal, then run them from terminal, with all these arcane sets of switches and parameters. Eesh.
It comes with Ubuntu, after all. In the case of zipping files, all you have to do is to go to the File Manager, find the file(s), select it or them, right-click on it or them, and select Compress and file type zip. It's so simple.
There have been a number of other tasks where I wind up spending hours figuring out how to implement the advice offered in these forums through Terminal. The folks who offer the advice often are so good at it that they leave out steps obvious to them, but that take a lot of work for somebody not as skilled at it to find out. After crawling through broken glass to get the job done, and normally screwing something up so it's not quite right once I get it going, I figure out how to do it through the GUI and find out it takes a fraction of the effort.
View 9 Replies
View Related
Jan 12, 2011
A co-worker was asking me if there was a way to recuperate his child's baptism photos from his HD after it had been reformatted following a crash. I heard that this was possible and even downloaded a few trial programs, but have yet to try them.
View 2 Replies
View Related
Jun 20, 2010
I want Play Mov file in Linux but Mplayer can't Play it. Only QuickTime can Play it. I download mpeg4ip and use bootstrap, when I use make command show error:
make[6]: *** [sys_block.lo] Error 1
make[6]: Leaving directory `/usr/local/src/Codec/mpeg4ip-1.5.0.1/common/video/iso-mpeg4/src'
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory `/usr/local/src/Codec/mpeg4ip-1.5.0.1/common/video/iso-mpeg4'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/usr/local/src/Codec/mpeg4ip-1.5.0.1/common/video/iso-mpeg4'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/usr/local/src/Codec/mpeg4ip-1.5.0.1/common/video'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/Codec/mpeg4ip-1.5.0.1/common'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/Codec/mpeg4ip-1.5.0.1'
make: *** [all] Error 2
What work? For Play QuickTime format in linux what work?
View 3 Replies
View Related
Apr 9, 2011
How can I convert video files .mov format to .mp4?
View 2 Replies
View Related
Feb 16, 2011
What is the problem? I receive this message (see in red) when i running this script (below) on bash script file:
error received:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 70 0 70 0 0 321 0 --:--:-- --:--:-- --:--:-- 0
IMAG_DOS.ZIP
[code]....
View 1 Replies
View Related
Feb 22, 2010
language: cOs: ubuntu 9.10 want a c or c++ program that gives the system uptime in YYYY: MM: DD HH : MM: SS format.eally it is head ditching..This is not home work or assisgnment..
View 10 Replies
View Related
Jun 5, 2011
I'm reading a book on assembly, and it talks a bit about the IEEE floating point format.
Quote:
To summarize, the following steps are used to convert a decimal number to IEEE single format: 1. The leading bit of the floating point format is 0 for a positive number and 1 for a negative number. 2. Write the unsigned number in binary. 3. Write the binary number in binary scientific notation f23.f22 ... f0 2^e, where f23 = 1. There are 24 fraction bits, but it is not necessary to write trailing 0's. 4. Add a bias of 127 to the exponent e. This sum, in binary form, is the next 8 bits of the answer, following the sign bit. (Adding a bias is an alternative to storing the exponent as a signed number.) 5. The fraction bits f22f21 ... f0 form the last 23 bits of the floating point number. The leading bit f23 (which is always 1) is dropped.
View 1 Replies
View Related
Dec 16, 2010
I made a string key-value mapping struct in C, and functions to add and remove entries. I would also like to write a function to read in this file format:
Code:
key: value
another: another value
[code]...
View 14 Replies
View Related