Programming :: Editing Text Files With Information From PostgreSQL DB?

May 16, 2011

Is there any way to edit text files with information in a database? The file is supposed to be always the same.. the information is going to be addedd in a specific format

View 2 Replies


ADVERTISEMENT

Programming :: Editing Text Using AWK?

Jan 11, 2010

Code:
echo -n "Title:"
read Title

[code]...

View 12 Replies View Related

General :: Write A Shell Script Which Will Simultaneously Collect OS User Information And Write In An Individual Text Files?

Feb 17, 2010

I want to write a shell script which will simultaneously collect OS user information and write in an individual text files.Can anyone tell me the syntax of the script.N.B. The user name will be mentioned in an array within the shell script.

View 8 Replies View Related

Programming :: Command For Find/Replace In Text Files (inc. Files In Sub-folders)?

Oct 11, 2010

I found this command that works great finding and replacing a simple string to another in files located in that folder and all sub-folders.

Code: find . -name '*.php' | xargs perl -pi -e 's/OldText/NewText/g'

The problem I have is that I need to replace a more complex string, like this: Old string: /mnt/stor6-wc2-dfw1/627896/982574/ New string: /mnt/stor8-wc2-dfw1/369587/302589/ There I don't know how to do it... since the / is what separates the old from the new strings, and the strings that I want to replace have / in it. Also, I would like to know how to specify under what folder replace the files, for example, I want that it search/replaces all files under /var/www/mysite/htdocs folder.

View 1 Replies View Related

Ubuntu :: Music File Information Editing Doesn't Save

Apr 5, 2010

I have some japanese music files stored on a flash drive that the titles of which are in japanese originally. While in the flash drive, when I go to Properties -> Audio, the title is written in japanese. It does not allow me to edit the file, no matter what permissions I have on it, therefore I can't change the name to english. So, I tried Rhythmbox instead, and transfered the file there. I could change the name, however there is STILL a huge problem.

I have around 300 japanese music files, all of which have to be renamed into english.
I did all this for all of them in Rhythmbox, and clicked "quit" when I was done. When I came back to transfer the files to my MP3 player like usual, I opened Rhythmbox, and...

ALL OF THE FILES WERE STILL IN JAPANESE! It didn't save any of the work I did on editing them. But, I calmed down and thought "oh, you can save playlists! I am sure that if I save them on one, it will keep the edits!" I did this, and it saved nothing. It took me 2 hours to finish the renaming, just to find out that it can't save information edits at all.

View 9 Replies View Related

Ubuntu :: Whenever Click On About Me - System->Preferences - Cannot See Any Information Editing Window

Nov 25, 2010

I have a very basic problem. Whenever I click on About Me(System->Preferences), I cannot see any information editing window. However, the mouse pointer does show the system is budy doing something, nothing shows up and then the pointer returns to default as if the system is no longer busy. What can I do to change my personal info?

View 5 Replies View Related

Programming :: Extract The Text From Files?

Aug 28, 2010

I have many files in a folder from which I need to extract some contents, these are basically text files wich have individual lines with (i.e)

name: john
address: whatever
phone: 123456

Some caveats

1. Sometimes a line might be missing.

name: johnn
phone: 123456

2. Lines are not in the same line-numbers across the files I did try some things with awk based on google searches but I couldn't extract the data of each file into a single line (this is the ultimate goal):

john,whatever,123456

I don't have knowledge other than having put some bash scripts together for backup jobs, so I am open to install anything that could to pull this off.

View 14 Replies View Related

Programming :: Substitute Text In Many Files?

Mar 11, 2010

I have this PHP Program I have been hobbying for years. Started in old PHP3 early PHP4. So with the newer PHP, things are starting to break! I have this string:

session_is_registered('UserID')

And I need to convert to this:

isset($_SESSION['UserID'])

in more than 200 scripts in my directory. I have been toying with perl (in a copy of the dir of course in case I really screw things over, lol) but am not gettig too far. The new code needs to swap ( ) for [ ] and i'm just all hung up! I am getting lost in Perl, I have this, but it does not substitute so I am missing something:

perl -i.bak -pe "s/session_is_registered('UserID')/isset(\$_SESSION['UserID'])/g" *.php

View 7 Replies View Related

Programming :: Find Files With Missing Text?

Oct 19, 2010

Need to make sure a security line is added in to every webpage on a site, trying to find out how to list only the filenames of the pages that are missing the text. awk or grep? o what I want is to list all files NOT containing the word 'securemasthead'

View 2 Replies View Related

Programming :: Reading And Writing Text Files In C?

Jan 1, 2011

Reading and writing text files in C?

View 9 Replies View Related

Programming :: Play With Calling Text Files In C

May 5, 2010

I am trying to play with calling text files in C. What I have is a text file with 4 columns of numbers I need to average 2 of them. I have started and hit a wall. I have the following so far:

[Code]....

I still need to figure out how to read the data in. I have been reading on this for a few hours and its not clicking. How does the program know which columns with names to call. the data is organized: ID, Day, Speed, Temp.

View 6 Replies View Related

Programming :: Read Entire Text Files Into C++?

Sep 15, 2010

im making a program (for the heck of it) that rewrites it code everytime it is run.(my ambition is to turn it into my c++ teacher and watch her be confuzled as to why she cant read my code and why it does weird things) Ive just started c++ programming, and managed to rewrite a program so that when it is run a second time, it says hello world. My problem is that I can only input the file as a single string. What I need to do is to be able to input the entire file into the c++ program, as a single object and then ifstream it out with the destination as the source code.

Also, it would help alot if there was someway to write additional lines to an existing text file instead of overwriting what is already there. That way, every time my c++ runs and rebuilds itself, it adds another couple of lines of code to a txt file and when the final iteration is complete, it loads a text file that was created by the program and uses it to program itself. I heard there is some sort of spawn command, can it be used to open up notepad and write to it? it would be awsome if my various programs could open different notepads with various messages

View 2 Replies View Related

Software :: Join 2 Text Files Based On First Number Present In Every Line Of The 2 Text Files?

Jan 22, 2010

I have 2 text files : file1.txt and file2.txt

cat file1.txt

15 this is a sentence containing various words and spaces
34 this is a another sentence containing various words and spaces

cat file2.txt

2 this is sentence1file2
6 this is sentence2file2
54 this is sentence3file2

I would like to join these 2 files. The result should look as follows :

cat joinedfile.txt

2 this is sentence1file2
6 this is sentence2file2
15 this is a sentence containing various words and spaces
34 this is a another sentence containing various words and spaces
54 this is sentence3file2

==> so the joined file must be sorted on the first number. Any ideas how this can be achieved ?

View 4 Replies View Related

Programming :: Pull Http Links Out Of Text Files?

Aug 15, 2010

I am trying to figure out a way to pull http links out of text files and then output the results in a log. The text files are in folders like this inside a source directory.

/source
./folder1
...folder1.txt
./folder2
...folder1.txt

[Code]....

View 4 Replies View Related

Fedora :: Editing A 26 Gigabyte Text File?

Jul 15, 2009

I did a pg_dump of our data warehouse, and it is 26 gigabytes. I wanted to load this data into a different database product (one that forked from Postgresql, so its syntax is very similar).I needed to change the syntax of the "COPY" command in the pg_dump output, remove references to "public", and change the table owner name. sed did these for me (albeit slowly). The output from pg_dump is a file called "pg-dump-output.sql".

pg_dump produces this:
Code:
...

[code]...

View 4 Replies View Related

General :: Text File Column Editing

Jul 17, 2011

I have 2 large text files , one looks like this:

<contact type="1">blahblah@hotmail.com</contact>
<contact type="1">blahblah2@hotmail.com</contact>
<contact type="1">blahblah3@hotmail.com</contact>

The other is a list of emails in single column format like this:

emailaddy@hotmail.com
emailaddy2@hotmail.com
emailaddy3@hotmail.com , etc

Is there a command to delete all the blahblah emails from text file 1 and replace them with the ones from text file 2?

Or maybe a linux version of 'Csved' which has the ability to add,remove,insert columns?

View 5 Replies View Related

Programming :: BASH Read Text List Zip Files Into A Single Archive?

Jul 22, 2010

AKA "zipping on the fly .. the slow-as-molasses way." The list includes full pathnames to each file, and they're all in subfolders of the same parent folder (which, unfortunately, is not the root folder of the drive or system on which the files reside). A cleaned-up and radio-ready portion of the list looks like

Quote:

.../taiga/ahqr-va-choyvp/bv0884-073.jpg
.../taiga/ahqr-va-choyvp/bv2635-073.jpg
.../taiga/ahqr-va-choyvp/bv3067-175.jpg

[code]....

What I'd like to be able to do is zip all the files in the list into a single archive, to avoid the step of having to copy them to the same location (presumably another folder on the HD) and then zip that folder. I'm more inclined to make provisions about extracting to a single folder at some other time. Is this possible in BASH, or would I have to consider a faster, more robust scripting language such as python or perl?

View 8 Replies View Related

Programming :: Creating A Ftp Script That Will Take Connection And File Details From Text Files?

Nov 23, 2010

I need a little help creating a ftp script that will take connection and file details from text files.For example:ftpscript.sh - script that looks for details and does transferftpparams.txt - ftp server connection details in single line csv formatftpfiles.txt - files that need to be transfer, one file per line.I have tried using awk with no success

View 2 Replies View Related

Programming :: Parsing Text Files In Bash / Cant Seem To Read The Array Back?

May 29, 2011

PI'm trying to write a script to list all open ports in the MINIUNPND chain in iptables and use the procotol, port and destination ip to open ports on another router using upnpc.Here is the output of iptables -L MINIUPNPD

Code:
>iptables -L MINIUPNPD
Chain MINIUPNPD (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere 192.168.3.124 tcp dpt:19955
ACCEPT tcp -- anywhere 192.168.3.124 tcp dpt:20054
ACCEPT tcp -- anywhere 192.168.3.130 udp dpt:10654
ACCEPT tcp -- anywhere 192.168.3.121 tcp dpt:29955
code....

No matter what i do i cant seem to remove the first 4 characters from the MYPROT array to leave only the digits. Also i cant seem to read the array back???

I thought it would simply be a loop reading each line and passing the fields in variables, executing upnpc commands i need then moving to the next line of the file until it reached the EOF.

View 12 Replies View Related

Programming :: Sed Regular Expression - Write Script To Edit Text Files?

Jun 29, 2010

I am trying to write a script to edit text files formatted like this:

Code:
(MCAL@Contig766:0.30207,CGIG@CVIR_Contig1014:0.13977,(HASI@HDIS_Contig573:0.16828,(CAPI@LCIN_5594371:0.36581,CFOR@FQH745302RIQ7Y:1.91244)0.160:0.00019)0.939:0.15648);
There are never line breaks or spaces in the actual files.

I want to delete all instances of the character "@" and everything between it and the next "," (including that comma) or the next ")" (including that close parentheses) whichever comes first. My desired output file would be like this:

Code:
(MCAL,CGIG,(HASI,(CAPI,CFOR)0.160:0.00019)0.939:0.15648);
I figured out how to do this using sed for either "," or ")" but both looking for whichever comes first.

View 6 Replies View Related

Debian Multimedia :: Scribus Crash When Editing Text

Jul 20, 2015

I use Scribus 1.4.4 without any changes from the Debian stable repository.

Each time when I edit text in the layout mode (not in the text editor) the program crashes with a "signal #11" message:

Code: Select all$ scribus
TIFFFetchNormalTag: Warning, Incompatible type for "RichTIFFIPTC"; tag ignored.
TIFFFetchNormalTag: Warning, Incompatible type for "RichTIFFIPTC"; tag ignored.
TIFFFetchNormalTag: Warning, Incompatible type for "RichTIFFIPTC"; tag ignored.
TIFFFetchNormalTag: Warning, Incompatible type for "RichTIFFIPTC"; tag ignored.
Scribus Crash
-------------
Scribus crashes due to Signal #11
Calling Emergency Save
Segmentation fault

On Wheezy I was using Scribus also, but without such problems. Unfortunately I often need to use the text editing in the layout mode in order to adjust the text flow for the final layout.

View 2 Replies View Related

Ubuntu Multimedia :: Video Editing / Text And Reverse

Apr 9, 2010

I'm trying to reverse a clip in kdenlive and add text on top of the moving clip, but cannot figure out how to do it..anyone know how or a program that can?

View 2 Replies View Related

Programming :: Postgresql Put '' In Column?

Apr 9, 2010

Problem is simple but I can't figure out how to solve it, I tried any possible way that I know but with no result.I'm using simple perl script with DBI and do select from one table and do update in other table with results from select, but I can't preserve my '' returned from select when doing update. I simply want my '' from first table to be '' in second but postgres makes them real new lines. I tried to escape '' with , '',"",E(I mean E'value here') in front of value that updating but they are always real new lines not '' in new table.

View 2 Replies View Related

General :: Text Editing Remote Edit With Local Editor

May 26, 2010

I have a server I can ssh into, and I am also running Ubuntu. How do I edit this remote file using any program I have installed on my local Ubuntu, without copying it to local, editing it, and copying it back?

View 4 Replies View Related

Programming :: Migrate DB From COBOL To Postgresql?

Jun 27, 2011

Is there a software or procedure to migrate DB from COBOL to SQL ( or postgresql)

View 10 Replies View Related

Debian Multimedia :: Scribus Crashes When Editing Text In Layout Mode

Sep 29, 2015

I use Scribus for designing leaflets and broshures. Unfortunately with the most recent version in the stable branch the program crashes each time I try to edit text in layout mode. I didn't have this problem in older versions. So I wonder if this is a bug others noticed in Scribus 1.4.4 on Debian GNU/Linux 8 (jessie) 32-bit.

For normal text editing I use the text edit mode anyway but when I try to fix line breaks it's always hard to not instantly see what I am doing. So even if I just want to insert a single character the program crashes with the following message: Scribus crashes due to Signal #11

View 3 Replies View Related

General :: Extracting Information From Multiple Text Documents?

Jul 7, 2010

I am an astronomy student using Ubunut 10.04, and a frequent user of IRAF ( an *nix image processing application geared toward astronomy). IRAF produces, amongst other things, a text document with various values on it (example below).

Code: K IRAF = NOAO/IRAFV2.14.1 version %-23s
#K USER = name %-23s
#K HOST = Balthazar computer %-23s
#K DATE = 2010-04-29 yyyy-mm-dd %-23s

[Code]...

Now, the information I'm actually interested is the X and Y coordinates down towards the bottom (in this case, 973.505, 271.474).

I have about 800 of these output text files, and I was wondering if there's any sort of script or command that could go through them (presumably reading from a list of file names), and extract the coordinates. Ideally, the output would be a list of coordinates (i.e. X-coordinate, Y-coordinate).

View 1 Replies View Related

Programming :: Right The Shell Script Which Talk To Postgresql Database?

Jul 22, 2010

i want to right the on linux box which have postgresql and i what some data from the different table and put it in .csv file.

View 2 Replies View Related

Debian :: Cups-pdf Creates PDFs With Garbled Text Information

Mar 14, 2012

I print something with cups-pdf. The pdf appears, it LOOKS as it should, BUT if i actually select text from the pdf viewer and try to paste it somewhere, i get messed up characters (sometimes no characters). So this means that searching too is out of the question i guess.

Why is this happening? I dont know if its a ghostscript issue because on Windows there are several gs based pdf printers and those create perfectly searchable pdfs. Is this a cups/cups-pdf specific issue?

PS Printing through the "Print to file" dialog creates good pdfs but i dont know how to replicate that via command line.

View 3 Replies View Related

General :: Writing A Script To Parse Information From A Text File?

Apr 29, 2011

Go to a specified directory and open a log file and parse out specific information and dump it into another text file.

View 4 Replies View Related







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