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
ADVERTISEMENT
Jan 28, 2009
I have a text file called file1.txt containing many lines eg.
line1
line2
line3
line4
line5
line6
Then i have another text file called file2.txt contains
3
5
6
Is there a command to remove the lines in file1.txt based on the keywords in file2.txt? note: It should remove line3,line5,line6 based on 3,5,6
View 10 Replies
View Related
May 15, 2009
Is it possible to create a text based menu layout in bash were it is possible to browse through. The menu list should look something like this:
----------------------------------------
user: root
colour: blue
number: 4
animal: dog
----------------------------------------
At the start the cursor should blink at the r from root so that text can be entered. When pressing the enter the cursor should go to the b from blue and so on. the imported thing is that all the text is visible also beyond the position from the cursor.
View 4 Replies
View Related
Jun 1, 2010
Can I use sed to include a text file in the beginning of other text files inside a folder and its subfolders? So it should be recursive.
View 4 Replies
View Related
Oct 18, 2010
I have two txt files containing x and y coordinates: xcoord.txt & ycoord.txt. I need to open them; read them line by line to get each coordinate; then each time I need to update Xs and Ys parameters inside another file called "dc.in" with the grabbed values.
Finally each time I need to run two exe files ( dc_2002 and st_vac) and produce corresponding output for each Xs and Ys ( dc.in is an input file for this exe files)
I have written the following code but it does not work:
View 14 Replies
View Related
Feb 26, 2011
I just set up apache on my PC and I cant change the permissions by right clicking because "I'm not the owner" and instead of using the chmod command on every file that I would like to edit I would just like to write a script on a text file, save it to my desktop so all I have to do is double click on it and boom I can edit all my files, etc.
View 2 Replies
View Related
Jan 19, 2009
I need to insert 3-4 lines of text to the beginning of a text file. The file is a largish MYSQL dump, the result of a backup shell script. This shell script should insert the required text.I've wrestled with sed, but lost.
View 2 Replies
View Related
Jan 13, 2010
I have to delete a certain line of text from the a textfile via ubuntu's shell scripting.I have done research, and it seems that most people advocate the usage of sed /d option. sed makes does not edit the text file. Hence, most options I discovered involved the use of a temporary variable/textfile and then overwriting the old file with the temporary new file. Is there anyway whereby I can bypass the use of temporary storage containers? I hope there is any magical combination of commands to edit the file directly.
View 3 Replies
View Related
Jan 8, 2011
I want to display something in my text view widget in glade using c code. that's all right.
now I need to attach a save button beneath the text view.so that on click the text view content should save as a txt file..
View 8 Replies
View Related
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
May 3, 2010
a sed command to add a text before line number in text file? I have text file with 500 lines, and i want to add 3 more lines with text after line 300, OR before line 302, isn't no problem.
View 16 Replies
View Related
Jul 8, 2011
I'm creating script to connect to mysql and perform function. I'm into process in querying mysql from shell. Here is the content of a sample script:
Code:
#!/bin/bash
USER=scripter
PASS=test123
DB=test_scripts
View 2 Replies
View Related
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
Apr 19, 2011
I have a .txt-file with ~50.000 lines of numbers, generated by a mathematics program. From this file, I need line ~ 1.100 to line ~16.000 (these lines are always the same btw, this may make the solution easier, dunno) to be copy/pasted to another file, where the lines ~500 to ~15.000 (also, every time the same) should be overwritten by the aforementioned lines...I haven't found or come up with anything that works yet, mostly I find solutions to copy everything from one file to another but I can't find something to specifically overwrite a part of a file with part of another.
View 4 Replies
View Related
Nov 11, 2010
What I plan to do is, create a duplicate file of a text file, and then append some text into the new text file.
View 1 Replies
View Related
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
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
Nov 4, 2010
I don't think this is a "perl one-liner" of find and replace. I'm trying to auto-fill some information in a listing of files. The simplest example is that in the files the following exists:
I would want the script to find this and populate it with something like -- Date : 20101004-1758
I have a few more similar fields to autofill, and I'd like to do this from within a larger perl script I'm developing to process these files. So, how I perform in-place file modification from within a perl script?
View 3 Replies
View Related
Jun 30, 2011
I had made some modifications in the source code of a software called "HomeBank". I'm not able to make a setup file using "Inno setup".how to create an .EXE file for the source code to execute.
View 2 Replies
View Related
Oct 2, 2010
Here is the deal: my school purchased a test prep which they distributed to us, the only problem is that it is for windows. When I try to run the exe in wine the program windows pops up but the screen is blank (i can see the menu bar and and the title bar). It appears that most of the information is located in a folder as html files (separated into chapters for each section) with links to all the figures/tables/questions
(also html files). This morning I have been trying to find a way to compile the html files into a format that I can read without having to hunt for each individual html file. I tried navigating with firefox but had to change each individual link before I could do that (very time consuming), I tried using doxygen (the GUI front end) to convert it to Latex/rtf/html/xml (all the formats) but did not have any success (It could be that I am using the app wrong). I tried opening some java applications found within the application data folder in hopes that it would bring up the navigator without success. And even tried installing java in wine (unsuccessfully) to see if that was the missing key to run the program in wine.
My question is, do I just have to fork out the $500+ that it would cost me to purchase the books instead of using the school provided program (free to us)? or is there a relatively simple way to compile these files into a format that could be readable.
tl;dr - have multiple html files for a windows native program that won't run on wine that I would like to convert to a more easily readable format (i.e. chm, pdf, etc), is it possible?the program was legally acquired through my school, I did not download or pirate it. I am not looking to distribute it, just looking to use it for my own studying purposes without spending $500+ or buying a windows license/computer.
View 2 Replies
View Related
Oct 21, 2010
I am wondering how I would go about creating a .deb file that would extract it's contents to two different folders. I would have one file directory that should be extracted to /opt and I have a second that should bextracted to the current user's home folder and /etc/skel - How would I go about doing this?
View 1 Replies
View Related
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
Jan 1, 2011
Reading and writing text files in C?
View 9 Replies
View Related
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
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
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
Feb 19, 2010
When trying to create a new compressed/archive file in Gnome Commander (GM) the file is created but the selected files are not added. I can open the new (empty) archive file and then add files to be compressed. I have tried using several different formats (zip, tar.bz and others) with the same results. The "file roller" is shown as a plugin but has no configuration other than the compressed file type.
View 2 Replies
View Related
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
View Related
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
Apr 30, 2011
I have a bunch of .7z files in a directory, and I need to put each one of them into a separate directory, named after the file (without extention). The command line I use:
Code:
find . -type f | mkdir `sed -e "s:..(.*)...:1:"` ; ls | grep .7z | cp * `sed -e "s:(.*)...:./1/:"`
Copying fails though:
[Code]....
PS. I don't want to use scripts, I want to do it using simple commands and piping.
View 5 Replies
View Related