Software :: Filter A Large Document By Line Number?

Feb 17, 2010

I have a 50000 line(ish) set of records in a file. I have another file where I have filtered out all the line numbers for those which have an error of various types. e.g column count, field type etc. I want to get all those lines into a separate file so I can sanitise them. There are abt 3-4000 of them.

How can I access those lines which I want to isolate into a single file? I have all the usual linux stuff available and a bit of understanding of regexps.

View 5 Replies


ADVERTISEMENT

Programming :: Filter Source Line Based On Results Line In Log Using Awk And Sed

Apr 5, 2011

I have a log file with entries such as;

Where result is 0 or more.

I want to get the list of file names where result count is more than 0 (in other words filter out files names with result 0).

File name and result are in two different lines in log file.

How can i filter file name based on result?

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

Software :: Fax To Phone Number And Be Able To View The Document Electronically?

Feb 26, 2009

I would like to have someone send me a fax to my phone number and be able to view the document electronically.
Is this possible? and if so what application do you recommend. I guess the concept is similar to eFax (but of course i don't want to pay).

View 1 Replies View Related

General :: Tar Not Working With Large Number Of Files?

Dec 6, 2010

in my middle of script i am using tar command to tar some 1000 images and size of each image is 5MB.

all the images are provided as argument as tar -cvf file.tar <all images as argument>

but my tar file file.tar does not contain all the images.

View 4 Replies View Related

Programming :: Create File Listing In C++ That Will Generate Line Number On Every Line Of Code

Apr 11, 2010

I have a project due for my Intro to C++ class and we are suppose to generate a file listing that will take an input of a C++ source code with .cpp extension and make a copy of it with a .lst extention that will have a line number preceding each and every line.

View 12 Replies View Related

General :: Getting The Line Of String From Previous Pipe Output By Line Number?

Feb 8, 2010

After running the following command, I get:

[root@yukiko /]# find / -iname .bashrc
/home/clamav/.bashrc
/home/vpopmail/.bashrc
/etc/skel/.bashrc
/root/.bashrc

But I would like to have a command that prints a specific line by supplying the command with the line number, for example:

[root@yukiko /]# find / -iname .bashrc | getline(2)
/home/vpopmail/.bashrc

Is there such a command on CentOS?

View 3 Replies View Related

General :: Sort By Line Size (number Of Characters In A Line)?

Jan 8, 2010

I want to sort a number of lines based on their size:

data:
-------
12345678
87654321
1234

[code]....

Should output as:
-----------------
1
2
12
21

[code]....

But i'm gettings this with sort
----------------
1
12
123
1234

[code]....

Can we sort the above "data" text, based on "number of characters" instead of "character order"?

View 8 Replies View Related

General :: Copying Large Number Of Files From One Directory To Another

Feb 10, 2010

I've a directory containing around 2.8 lacs of files. I want to move them to another directory.If I use cp or mv then I get an error 'argument list too long'. If I write a script like

for file in ls *; do
cp {source} to {destination}
done

then because of ls command , its performance degrades.How can I do this?

View 7 Replies View Related

General :: Copying Large Number Of Files In Windows?

Mar 15, 2011

I am facing problem in copying a large number of file 18 lakh (18,000,000) files from my personal hardisk to another hardisk each file is very small and size of folder is around 3.95 GB copying files using copy given by Windows is frustrating and I am not even able to compress file its giving me error that its not readable.And problem is I am not able to open this drive in Linux it showing me error there saying do diskchk in Windows and Windows disk check is also not able to repair this drive and goes into some mode unsolvable.Is there any way to open disk with error to open in Windows and if not any way I can copy data faster?ERROR: Disk labled EDU is corrupt go to windows and chkdsk /f there and reboot into window 2 times.

View 3 Replies View Related

General :: Using Sed To Replace A *large* Number Of Variables In A File?

Jul 28, 2011

I have a large number of log files, on a linux box, I need to cleanse sensitive data from before sending to a third party. I have used the below script on previous occasions to perform this task, and it has worked brilliantly (script was built with some help from here :-)

#!/bin/bash
help_text () {
cat <<EOF
Usage: $0 [log_directory] [client_name(s)]
EOF

[Code]...

However, now one of our departments has sent me a CLIENT_FILE.txt with 425000+ variables! I think I may have hit some internal limit. I have tried splitting the client file into 4 with around 100000 variables in each, this still doesn't work. I'm loathe to keep splitting though as I have 20 directories with up to 190 files in each directory to run through. The more client files I make, the more passes I have to do.

View 2 Replies View Related

General :: Share A Large Number Of Files Into Chroot Env?

Aug 17, 2010

I understand that chroot is usually used to provide security, however, for my issue, security is a big don't care. I am very new to using chroot and don't fully understand how the chroot'd env works.

problem: Trying to use a vendor supplied cross compile environment. The environment runs as a chroot'd env and works just fine. I have a large number of additional modules that I wish to compile in the chroot'd environment. FYI, these modules are also (succesfully) compiled for other targets not using chroot'd env's. Copying the source files into the the chroot environment is not an option (don't have hours to wait for copies to finish and it would break the make system). Having them live in the environment is also not an option (the chroot build is a tiny part of the build process and we cannot revamp our entire source tree to accommodate it).

I am looking for a way to have the compiler in the chroot'd env have access to a path that is outside of the env and typically higher up in the same path that holds the chroot'd env. I have tried soft links (they don't work as expected). Hard links only work for single files and there are 10's of thousands of files that would need to be linked. I am not sure how I would go about exporting the additional files and then mounting the exported files in the chroot'd env (or if that would even work).

View 2 Replies View Related

CentOS 5 Networking :: Configuring For Large Number Of Tcp Connections?

Jan 24, 2011

i've got a select based application that wants to support a large number of mostly idle connections. the code is java and works on windows, suse enterprise linux, mac os x. it does not work on centos 5.5 (32-bit, 2.6.18 kernel, 1G of memory).

i've read and followed the directions in various articles about tuning linux for large numbers of connections (including the C10K problem), and gotten the number of sockets up to 3200.

these didn't make any apparent difference:

[URL]

on windows, i can get up to around 78,000.

on suse enterprise linux (a few years ago), i got up to 90,000. that's where i got bored and stopped.

on my mac laptop with os x (snow leopard), i got up to 10,500.

i have used ulimit -n 10240

my current goal is 10k sockets.

the test is that i'm opening one socket at a time until it fails. when it fails, many of the sockets which have already been opened also fail, in one giant cascade. sounds like a buffer / memory problem.

each group of 64 sockets gets a thread to manage select calls for them. thus i'm only using around 61 threads total when it fails.

View 3 Replies View Related

General :: How To Delete A Line At Specific Line Number

Jun 15, 2010

I m writing a script to delete a line at particular location.

But i m unable to use variable for specifying line number.

For example.

Code:

works fine and deletes 7th line from my file

But

Code:

gives following error.

Code:

View 7 Replies View Related

Ubuntu :: Can't Find Any Process That Consume Such Large Number Of Memory

Feb 23, 2010

I used 9.04 for months and it work fine before restarting my PC. After I restarted my PC, the memory consumption takes up to 4.2 GB after login. However, I cannot find any process that consume such large number of memory.

[code]....

View 3 Replies View Related

Ubuntu :: Adding Additional Users Causes Large Number Of Errors?

Jun 29, 2010

I'm running 64-bit 10.04, upgraded from 9.10. The problem I am experiencing is that any user accounts aside from my main account are problematic. This includes any accounts I add, as well as the GDM guest session.The specific problems that I have thus far experienced are as follows:

1. The desktop loads often improperly. In the latest instance of this the graphics on the right side top panel were randomly chopped-up, leaving parts of my clock on either side of the volume control, among other things. 2. If I make ANY customizations to the desktop at all, the desktop takes nearly a full minute to load on log-in. 3. Flash videos don't work properly on Firefox. Sometimes they only play after refreshing a page, often they will not load at all. Also, attempting to load or play a flash video will sometimes causes Gnome or Firefox to crash. 4. (And this is the one that REALLY has me stumped) Whenever I log into my main accountant after logging out of another account, the IBus control appears in my system tray.However, when I open the IBus preferences the associated check box is (and has always remained) unchecked.Not sure where to go with this one. More than anything, the IBus bug makes me unsure of where to even begin looking for the problem.

View 1 Replies View Related

Ubuntu :: Data Loss When Transferring Large Number Of Files?

Jul 20, 2010

This problem is not exclusive to Ubuntu, I've experienced it in Windows and OSX as well, but it seems that almost every time I transfer a large number of files (i.e. my music collection) between my desktop computer and laptop via my external hard drive, I end up losing files for no reason. I usually don't notice the files are missing until later on, because I am never informed of any data loss. Now, every time I make a large transfer of files, I just do it two or three times to ensure that I don't lose any files.

View 2 Replies View Related

Ubuntu :: Find And Move Commands On Large Number Of Files ?

Feb 21, 2011

We recovered a large number of files from a HD I messed up. I am attempting to move large numbers of files of a type e.g. .txt .jpg , into a folder by type to more easily sort through them.

Here are the commands I have mainly been trying with various edits:

Code:

Code:

So far the most common complaint I have gotten "missing arguments to execdir".

This is on Ubuntu 10.04

View 6 Replies View Related

Applications :: Extract The Sender Id From A Fairly Large Number Of Files?

Nov 18, 2010

I'm trying to extract the sender id from a fairly large number of files and am having trouble assigning variables from a file. Here is what I have so far, (which is fairly kludgy I know, but it's been some years since I've done any scripting or programming, and I find that I have lost the knack to a large degree).

[Code]...

View 1 Replies View Related

CentOS 5 :: 5.2 Installation Hangs On Server With Large Number Of Drives?

Apr 6, 2009

I am attempting to upgrade a system from 4.7 to 5.2 using a (now) DVD drive attached to the onboard IDE. Originally I had tried using a remote NFS image and a USB stick but I thought maybe there was a problem with the image. I can get up to the point of the installation of selecting the keyboard for the system and then it freezes and never goes any further. It doesn't appear to be a kernel panic since I can still switch between consoles.

I've got an MSI K9NGM2-FID with 14 drives in it. It serves as a file server for our backup server. It's got a secondary 4 port Silicon Image SII 3114 SATA card using the sata_sil module, and an old IDE Promise FastTrak TX2000. Technically I could have 16 drives but the 750W PS is walking the fine line on tripping it's self-breaker with the 14 drives and 7 fans. I would like to NOT have to disconnect all of this to do the upgrade.

I thought maybe that running the install using the "noprobe" option would help so it didn't detect and load the modules for the Silicon Image or the Promise cards and detect all of the drives but it still gets stuck on the step after selecting the keyboard. The installation info console and the dmesg console don't really provide any useful information. The installation console says:

INFO : moving (1) to step welcome
INFO : moving (1) to step language
INFO : moving (1) to step keyboard
INFO : moving (1) to step findrootparts

And the last lines of the dmesg console says:

<6>device-mapper: multipath: version 1.0.5 loaded
<6>device-mapper: multipath round-robin: version 1.0.0 loaded
<6>device-mapper: multipath emc: version 0.0.3 loaded

Is there a hidden "debug" option that will turn on a lot of extra logging?

View 7 Replies View Related

Ubuntu :: Large Number Of Files To Count - Argument List Too Long

May 28, 2011

I have the standard problem of trying to count a large number of files in a directory (>100k)

I have tried: ls ~/user/images/* -l | wc -l and find ~/user/images/* -maxdepth 1 -type f | wc -l

In both cases, I get the argument list too long error message.

I have tried using xargs but I can't seem to get it to work right.

The command

returns a valid answer but it includes all the subdirectories in the file count.

View 4 Replies View Related

General :: Convert A Large Number Of File Types From None Standard To Text?

Sep 28, 2009

I have on my windows machine several hundred files that are a format of .nc .ncs for a CNC machine. I need to convert them to txt which is something as easy as opening in notepad and then saving as .txt but there are so many that this kind of action would take way too long.

The reason I am writing the linuxquestions is because I would feel more comfortable in loading a live CD and using some sort of terminal command to do this than I would to download one of the many "freeware" type programs I have found for windows (even more so since I have had a root kit before and had to start all the way over to get rid of it).

I need to know:

1. Is this possible to do with the terminal without super advanced knowledge.

2. Can one please point me in the right direction; something to read or an example

View 2 Replies View Related

Programming :: BASH Script Optimization For Testing Large Number Of Files

Sep 18, 2010

I want to move files from a $SOURCEDIR to a $DESTBASE/$DESTDIR. Under $DESTBASE there are many directories, and I need to test beforehand if a file from $SOURCEDIR already exists in any of them.

This is obviously extremely slow, and the real use case involves dozens of dirs and thousands of files. Creating a temporary "index" file for the find command (instead of running it every iteration) speeds it up a little, but it's still very clumsy.

View 14 Replies View Related

General :: How To Add Such Filter To Rsync Command Line

Oct 27, 2010

I'm trying to understand rsync filters .. but it isn't goig to well.I want to rsync only files with a specific extension (.gz.des3). Could someone please tell me how to add such filter to the rsync commandline (not a seperate filter filer).

View 2 Replies View Related

General :: Sed - Print Line Number Along With The Line?

Jan 30, 2011

I want to print the line number with the pattern of the line on a same line using multi-patterns in sed. But i don't know how to do it. For example, I have a file

abc
def
ghi

I want to print

1 abc
2 def
3 ghi

View 6 Replies View Related

Software :: Filter Printed Line To Get Characters Between 2 Expressions?

Jan 28, 2011

I'm having trouble getting a sed command to work. I need to filter a printed line to get characters between 2 expressions. "<job>" and "<url>".

Code:
echo "<job>TEST<url>http://www.project.com/?code=001" | sed 's/^[<job>]*//' | sed 's/[<url>]*$//'
Produces:
Code:
TEST<url>http://www.project.com/?code=001

It takes off the first part but why is that not deleting the "<url>" and all the parts after that?

View 9 Replies View Related

Programming :: Line Buffering Using Here Document In Bash?

Jan 22, 2010

I keep time sheet entries at work in an sqlite database called 'timesheet'. I have a shell script called 'today' which queries for all timesheet entries which are less than 24 hours old; it looks like this:

Code:
#!/bin/bash
echo "select datetime(start_time, 'unixepoch', 'localtime'), datetime(end_time, 'unixepoch', 'localtime'), project, site, duration from timesheet where start_time > strftime('%s', 'now', '-1 day', 'localtime');" | sqlite3 ~/.timesheet/timesheet.db

In an effort to make it more readable, I've put the query inside a here document:

Code:
#!/bin/bash
cat | sqlite3 ~/.timesheet/timesheet.db << query
select

[Code]...

View 2 Replies View Related

Hardware :: Mem - 'input Output Error On Sr0 Logical Block (a Large Number) After A Long Time The Booting Proceeds To A Point

Aug 29, 2010

I have been having a lot of trouble lately with installing from CD/DVD. The DVD reader/writer on this laptop is new. Nevertheless, trying to install Ubuntu onto an exernal HD, I get 'input output error on sr0 logical block (a large number) After a long time the booting proceeds to a point, but I never get the actual installation started, and have to shut down manually.

The CD is fine, says the Ubuntu-checker. I just installed using my sons laptop, and there was no trouble. Question: does this indicate a motherboard failure? A memory block damaged? Do you know of a diagnostic tool I can use to check the reading of a CD/DVD?

View 7 Replies View Related

General :: Convert A DjVu Document To PDF - Using Only Command Line Tools?

Jan 26, 2010

I've got some documents in DjVu which I'll like convert to PDF. Is there a way to do this using command line OSS tools?

View 2 Replies View Related

Fedora :: Get ADF (Auto Document Feeder) On A Printer To Work From Command Line?

May 4, 2010

know how to get ADF ( Auto Document Feeder ) on a printer to work from command line?

Running F12 and my printer is HP OfficeJet 7310xi

---------- Post added at 10:57 PM CDT ---------- Previous post was at 10:17 PM CDT ----------

I found this scanimage -b --batch-scan=yes > output.pnm

View 2 Replies View Related







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