Renaming files using a list of names in a txt or csv file
Hello everyone,
I'm trying to use AppleScript (although I'm a total noob to it) to rename the files in a folder (if possible using something like this - set folder to choose folder) to coincide to a list of names (in a txt or csv - can be any extension needed).
To paint the picture clearer I'll have something like this
Files_as_they_are
Files_renamed
01.mkv
Valar Dohaeris.mkv
02.mkv
Mhysa.mkv
Here is what I've tryed so far : (some point through the night I've tryed to repeat part of the process thus the "fcount" but the result was even worse)
set theFolder to choose folder
set ep to {"Valar Dohaeris", "Dark Wings, Dark Words"}
set fcount to 1
tell application "Finder"
set name of file fcount of theFolder to item fcount of ep
end tell
set fcount to fcount + 1
Tnx in advance...
This will work with a comma separated text file,
i.e.:
Files as the are, Files Renamed
01.mkv, Valar Dohaeris.mkv
02.mkv, Mhysa.mkv
Note that if the file to be renamed exists, it will be overwritten (A test can be added to skip if exists if needed)
set theFoler to POSIX path of (choose folder with prompt "Choose folder with Files" default location path to desktop)
set theFile to POSIX path of (choose file with prompt "Choose TXT file" default location path to desktop)
do shell script "
cd " & quoted form of theFoler & "
while read line
do
OldImageName=${line%,*}
NewImageName=${line#*,}
if [ -e \"$OldImageName\" ] ; then
mv \"$OldImageName\" \"$NewImageName\"
else
echo \"$OldImageName\" >> ~/Desktop/Errors.txt
fi
done < " & quoted form of theFile & "
Similar Messages
-
How can we a validate a CSV file in SSIS and log the error details in another CSV File by using Sript Task.
Please see:
http://www.bidn.com/blogs/DevinKnight/ssis/76/does-file-exist-check-in-ssis
http://social.msdn.microsoft.com/Forums/en-US/01ce7e4b-5a33-454b-8056-d48341da5eb2/vb-script-to-write-variables-to-text-file -
I accidentally created files using a Free Trial version of InDesign. Now the files are gone. Where did they go? How do I get them back? I pay for Creative Cloud... but used the wrong login apparently.
Files you save don't disappear, even if you no longer have the software that created them. They're right where you saved them.
-
.txt or CSV file to Database
Hi-
I have a text file generated by a Pulse Oximeter, What I want is, as the system recieves the file (in .txt of CSV) it automaticly is entered into a MySql Database or SQL Server and generates an SMS message. Thanks
Regards
Tayyab HussainWeb services imply using sychronous communication. However, the use case you describe implies that asynchronous, so-called fire-and-forget, communication is better suited to your needs.
For example, with sychronous communication, the system is unaware of the exact moment a TXT or CSV file will come in. Also, when the system is processing a file, all other processing waits until the system finishes. This may cause synchronicity problems if multiple files come into the system in quick succession.
ColdFusion has an asynchronous solution that suits every requirement of your use case. The following methods will enable you to receive the file, to automatically enter it into the database and to generate an SMS message. Use ColdFusion's DirectoryWatcher gateway to monitor the directory in which the TXT or CSV files are dropped, and ColdFusion's SMS event gateway to send SMS messages.
Whenever a third party drops a file into the directory, an event is triggered, setting the DirectoryWatcher into action. Implement a query in the onAdd method of the DirectoryWatcher's listener CFC to store the file in the database. Following the query, use the sendGatewayMessage method to send the SMS message. -
Insert Data into Table from TXT or CSV file !!!!!
Dear All,
Recently I have started working on APEX. In Oracle Forms, we used to use TEXT_IO for inserting records into tables from txt files. Now I want to do the same thing in apex 3.2. How can I insert data into tables from txt of csv files.
Waiting of your valuable suggestions.
With kind regards,
Yousuf.Yousuf
wwv_flow_files is used by APEX to hold uploaded files.
If you incorporate a file browse item on you page, browse for the selected file, then submit the page (having the PL/SQL process described as an on suibmit process) then what I detailed should work.
If you don't need users to have access to this then just go to Home>Utilities>Data Load/Unload in APEX and there is a handy load utility there that does it all for you.
Cheers
Ben -
Batch Renaming Image Files from a list of names
I would like to use the batch rename function in Bridge CS5 to quickly rename newly uploaded image files of our products. I would like to rename the image to it's corresponding product number. The issue is that the product numbers aren't in exact numerical order (ie. the first pic is of product ES2004 and the next one is for ES2012). The product numbers can sometimes end with a letter or a number. The pictures are taken in order of the product numbers on an excel sheet. What's the easiest way to have bridge name the image file to its corresponding part number?
Here is an example script that will do the re-naming also place the original filename into the metadata.
CSV format is fileName,Product IE:
p1020337.jpg,E179562
p1020338.jpg,Z556301
Copy and paste the script into ExtendScript Toolkit (This gets installed with Photoshop)
Open Bridge
Edit > Preferences > Startup Scripts
Click "Reveal My Startup Script"
Save the script into this folder.
Close and restart Bridge and accept the new script.
To use, navigate to the folder with the documents to rename, "Right mouse click Menu" select "Rename to Product" and select your csv file.
#target bridge
if( BridgeTalk.appName == "bridge" ) {
fileNameToProduct = MenuElement.create("command", "Rename to Product", "at the end of Thumbnail");
fileNameToProduct.onSelect = function () {
renameToProduct();
function renameToProduct(){
var Path =app.document.presentationPath;
var descFile = File.openDialog("Open Product File","CSV File(*.csv):*.csv;");
if(descFile == null) return;
descFile.open('r');
var datFile=[];
while(!descFile.eof){
var line = descFile.readln();
if(line.length > 5) datFile.push(line);
descFile.close();
for(var t in datFile){
var str=datFile[t];
str= str.split(',');
var fileName = File(Path+"/"+ str.shift());
var product = str.shift();
if(!fileName.exists) continue;
var ext = fileName.toString().toLowerCase().match(/[^\.]+$/);
var thumb = new Thumbnail(fileName);
var md = thumb.synchronousMetadata;
md.namespace = "http://ns.adobe.com/xap/1.0/mm/";
md.PreservedFileName = thumb.name;
$.sleep(100); //give it time to update the metadata
var newName = product + "." +ext;
fileName.rename(newName);
alert("All done"); -
Hello Guys,
I have created a Device collection for UK region (2000+ machines)
Now i have been given a list of 1000 machines to which i need to deploy an application.
I have to create a device collection for this 1000+ machines. as an input i have a excel or CSV file with a list of machine names.
Please suggest me how can i create a device collection with CSV file as input. Is my CSV file should be in particular format.
Or is there any other way i can create a collection for this 1000 specific machines.
Please suggest.My previous post was for sccm 2012.
here its for 2007
In the Operating System Deployment section of SCCM right click on Computer Association and choose
Import Computer Information
when the wizard appears select Import Computers using a file
The file itself must contain the information we need in this (CSV) format
COMPUTERNAME,GUID,MACADDRESS
(sample below)
Quote
deployvista,3ED92460-0448-6C45-8FB8-A60002A5B52F,00:03:FF:71:7D:76
NEWCOMP1,55555555-5555-5555-5555-555555555555,05:06:07:08:09:0A
NEWPXE,23CA788C-AF62-6246-9923-816CFB6DD39F,00:03:FF:72:7D:76
w2k8deploy,BFAD6FF2-A04E-6E41-9060-C6FB9EDD4C54,00:03:FF:77:7D:76
if we look at the last line, I've marked the computer name in Red, the GUID in BLUE and the MAC address in GREEN, separate these values with commas as above.
w2k8deploy,BFAD6FF2-A04E-6E41-9060-C6FB9EDD4C54,00:03:FF:77:7D:76
the file can be a standard TEXT file that you create in notepad, and you can rename it to CSV for easier importing into our wizard...
so, click on Browse and browse to where you've got your CSV file
on the Choose Mapping screen, you can select columns and define what to do with that mapping, eg: you could tell it to ignore the GUID value (we won't however)
on the next screen you'll see a Data Preview, and this is useful as it will highlight any errors it finds with a red exclamation mark, in the example below a typo meant that it correctly flagged the MAC address as invalid
so edit your CSV file again and fix the error, click previous (back) and try again
Next choose the target collection where you want these computers to end up in
review the summary
in SCCM collections, we can now see the computers we've just imported from File,
Enjoy
Nikkoscy -
Creating new flat file using TextEdit w/specified name and path
Hi all,
I am working on an Applescript to create a blank new plain text file (in /tmp with a unique filename derived from today's date and time) and am missing something 'cause I keep getting an error message.
Here's the code:
<pre class=command>
set Today to (do shell script "/bin/date +%Y%m%d%H%M%S") as string
set DefaultFilename to (Today & "TMP.txt") as text
set TMPpath to "/tmp/" as text
set TMPFile to (TMPpath & DefaultFilename)
tell application "TextEdit"
set NewDoc to make new document with properties {name:DefaultFilename, path:TMPpath}
end tell
</pre>
When I run the above code snippet I get the Applescript error message:
TextEdit got an error: NSArgumentsWrongScriptError
I understand that the properties listed in the make command should be a record, and that the individual properties comprising the record should each be text.
What am I missing here? Something obvious I suspect.
Any ideas would be greatly appreciated!
EdYou're trying to use Unix-style paths for a Cocoa app, and that won't work.
You need to use Mac-style paths, that is, colon-delimited, not unix-style (slash-delimited) paths.
<pre class=command> set Today to (do shell script "/bin/date +%Y%m%d%H%M%S") as string
set DefaultFilename to (Today & "TMP.txt") as text
set TMPpath to ":private:tmp:" as text
set TMPFile to (TMPpath & DefaultFilename)
tell application "TextEdit"
set NewDoc to make new document with properties {name:DefaultFilename, path:TMPpath}
end tell</pre>
A slightly better solution is to use the path to command rather than a hard-coded path. path to temporary items will give you the path to the current OS temporary file directory, which is more reliable than hard-coded strings, especially since non-English versions of the OS mght not use the same path names.
<pre class=command> set TMPpath to path to temporary items as text</pre> -
Is there a way to name the .indd files created by a data merge with values in the CSV file
I have a data merge document that is set to single Record per Document page and 1 page per document. In my CSV file I have a field for Part Number. If I run a data merge with 10 records I end up with 10 .indd files. I need a way so that the resulting .indd files are named the same value that is in the Part Number field.
Loic has provided a link for my original piece, and I've written up some follow-up pieces for indesignsecrets.com:
http://indesignsecrets.com/data-merging-individual-records-separate-pdfs.php
http://indesignsecrets.com/data-merging-individual-records-separate-pdfs-part-2-scripting. php
So there are several ways to get unique name PDFs from an indesign Data Merge. However, none of these 3 articles will truly answer your question of how to get unique indesign filenames using the database. I can see a practical purpose for this as merging business cards directly to PDFs is great, but I can be guaranteed that while on proof, there will be alts to the business cards that need to be done outside the merge, meaning specific records need to be exported to indesign files for further manipulation. -
Import List Items with Managed Metadata Field from CSV File
Hello,
I try to import list items from a CSV File. Most of the fields are populating correctly except the Managed Metadata Field. I found multiple examples on how to set Managed Metadata Fields with Powersehll, but unfortunately I couldnt get it running.
The CSV File holds values for the Metadata Column, this value should be checked against the Metadata in the Termstore. If this Term is existent, then it should set the fields value, if it is not existant then it should add the term from the CSV File to the
Term Set in the Term Store. Can anybody give me a tip on how to do this? This is what I have, where Line 4 holds the Metadata:
$Siteurl = "http://siteUrl"
$Rootweb = New-Object Microsoft.Sharepoint.Spsite($Siteurl);
$Webapp = $Rootweb.Webapplication
$listName = "Catalogue"
$listWeb = Get-SPWeb $Siteurl
$list = $listWeb.Lists[$listName]
$pfad1 = "c:\temp\Servers.csv"
$content = import-csv -Delimiter ";" -Path $pfad1
foreach ($line in $content) {
$newItem = $list.Items.Add()
$newItem["Field 1"] = $line.1
$newItem["Field 2"] = $line.2
$newItem["Field 3"] = $line.3
$newItem["Field 4"] = $line.4
$newItem.Update()
write-host $line.Title imported
Thanks!!Hi Jimmie,
From your description, when importing list from csv to SharePoint site, you would like to compare if Managed Metadata column exists in term store, and return yes value, if not, add it to term store.
That might need script to achieve. You need to import list at first, then get value from term store, and compare with the list. Change the list field per comparison result, then add new value to term store.
However, there might some workaround to meet your requirement. Not surly understand, so I find some references for you:
If you would like to export Term Set to CSV from SharePoint 2013, then you could compare it:
http://gallery.technet.microsoft.com/office/PowerShell-for-SharePoint-a838b5d0#content
If you would like to query SharePoint 2013 Managed metadata term store using JavaScript:
http://sharepoint.stackexchange.com/questions/60045/query-sp2013-managed-metadata-term-store
http://stackoverflow.com/questions/13858962/getting-all-the-term-stores-in-sharepoint-2010-web-services-or-client-side-obje
If you would like to synchronize, import or copy term store & managed metadata in SharePoint between environments:
http://www.matthewjbailey.com/synchronize-import-or-copy-term-stores-managed-metadata-in-sharepoint/
Regards,
Rebecca Tu
TechNet Community Support -
Script to export a list of notes from Evernote to a CSV file
Hi,
I am wondering if anyone knows of a script that would export a list of all the notes currently selected in Evernote (or alternatively all of the notes in a particular notebook) to a CSV file.
I am hoping that I could adapt such a script to my needs, which are as follows:
Generate a CSV file with 4 values per row (1 row per note), namely 'Date,Price,Item,Tag"
Each of my notes has a title in the format: "20110801 10.00 Note1" (i.e. date,price,item)
So the first three values in the CSV file would be constructed from the title of the note with the date converted from the form 20110801 to 01/08/2011.
The tag in the note would become the fourth value in the CSV file.
I'd be grateful for any help in writing such a script.
Thanks,
NickWhat is the version you are using?
Try this:
exp userid=scott/password@orcl parfile=parfile1.txt
and the contents of parfile1.txt would be:
BUFFER=10000
FILE=test.dmp
FULL=n
OWNER=scott
GRANTS=y
TABLES=SBEDIAUD,CE090001,CE091002,CE091004,CE091006,.........
But yes you should be using expdp by now.
regards -
Script to ping multiple hosts and return domain info to a txt or csv file
Hi,
I wonder if anyone can help. I need a script that will allow me to ping multiple hosts (all listed on seperate lines in a txt file) and return IP, server up\down and domain info to a txt or ideally a csv file.
I'm sure this must have been done\requested before but I can't seem to find the correct script anywhere
Thanks for your help
MalTry this modification:
$result=@()
Get-Content p:\list.TXT | %{
$start_name = $_
$conn = Test-Connection -ComputerName $_ -Quiet
if(-not $conn)
$start_name = ""
Try
$dns = [System.Net.Dns]::GetHostEntry($_)
$dns_host = $dns.HostName
$dns_ip = $dns.AddressList | select -ExpandProperty IPAddressToString
catch
$dns_host = "invalid host name" #as jrich proposed :)
$dns_ip = "invalid host name" #as jrich proposed :)
$start_name = ""
$HostObj = New-Object PSObject -Property @{
Host = $start_name
IP = $dns_ip
DNSHost = $dns_host
Active = $conn
$result += $HostObj
$result | Export-Csv p:list.csv -NoTypeInformation -
Hi,
I am trying to upload flat file data using the FM GUI_UPLOAD for .TXT file and
FM TEXT_CONVERT_XLS_TO_SAP for .Xls and .csv files
My internal table is as follows
TYPES : BEGIN OF ty_f64,
field(255) type c,
END OF ty_f64.
data : it_f64 type table of ty_f64.
Example Flat file data is as follows
H 20112008 DR 0001 20112008 INR
L 01 61 1000
L 50 41000 1000
H 20112008 DR 0001 20112008 INR
L 01 61 1000
L 50 41000 500
L 50 41000 400
L 50 41000 100
My problem is that only the first field i.e H or L is getting updated into my internal table but I want whole record to be the content in one row
i.e in RUN TIME I see the internal table data as
H
L
L
H
L
L
L
regards
PrasanthCheck the below code
REPORT ZSRK_073 .
CLASS CL_ABAP_CHAR_UTILITIES DEFINITION LOAD.
TYPES : BEGIN OF TY_F64,
FIELD(255) TYPE C,
END OF TY_F64.
DATA : IT_F64 TYPE TABLE OF TY_F64,
WA_F64 TYPE TY_F64.
TYPES : BEGIN OF TY_HEADER,
RECNO TYPE I,
INDICATOR,
BLDAT TYPE BLDAT,
BLART TYPE BLART,
BUKRS TYPE BUKRS,
BUDAT TYPE BUDAT,
WAERS TYPE WAERS,
END OF TY_HEADER.
TYPES : BEGIN OF TY_ITEM,
RECNO TYPE I,
INDICATOR,
NEWBS TYPE NEWBS,
NEWKO TYPE NEWKO,
WRBTR(16), " TYPE WRBTR,
END OF TY_ITEM.
TYPES : BEGIN OF TY_TAB,
F1,
F2(10),
F3(17),
F4(17),
F5(10),
F6(5),
END OF TY_TAB.
DATA : IT_HEADER TYPE TABLE OF TY_HEADER ,
IT_ITEM TYPE TABLE OF TY_ITEM,
WA_HEADER TYPE TY_HEADER,
WA_ITEM TYPE TY_ITEM,
IT_TAB TYPE TABLE OF TY_TAB,
WA_TAB TYPE TY_TAB.
DATA : L_REC TYPE I,
FLAG.
CONSTANTS : C_HTAB TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
DATA : FNAME TYPE STRING VALUE 'C:\TTT1.xls',
L_FILE LIKE RLGRAP-FILENAME.
IF FNAME CS '.TXT'.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FNAME
FILETYPE = 'ASC'
TABLES
DATA_TAB = IT_F64.
PERFORM SPLIT_TEXT_TABLE TABLES IT_F64.
ELSEIF FNAME CS '.XLS'.
L_FILE = FNAME.
PERFORM UPLOAD_XLSFILE TABLES IT_TAB
USING L_FILE.
PERFORM SPLIT_XLS_TABLE TABLES IT_TAB.
ELSEIF FNAME CS '.CSV' .
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FNAME
FILETYPE = 'ASC'
TABLES
DATA_TAB = IT_F64.
PERFORM SPLIT_CSV_TABLE TABLES IT_F64.
ENDIF.
*& Form UPLOAD_XLSFILE
text
--> p1 text
<-- p2 text
FORM UPLOAD_XLSFILE TABLES P_TABLE
USING P_FILE.
DATA : L_INTERN TYPE KCDE_CELLS OCCURS 0 WITH HEADER LINE.
DATA : L_INDEX TYPE I.
DATA : L_START_COL TYPE I VALUE '1',
L_START_ROW TYPE I VALUE '1',
L_END_COL TYPE I VALUE '256',
L_END_ROW TYPE I VALUE '65536'.
FIELD-SYMBOLS : <FS>.
CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
EXPORTING
FILENAME = P_FILE
I_BEGIN_COL = L_START_COL
I_BEGIN_ROW = L_START_ROW
I_END_COL = L_END_COL
I_END_ROW = L_END_ROW
TABLES
INTERN = L_INTERN
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
FORMAT COLOR COL_BACKGROUND INTENSIFIED.
WRITE : / 'File Error'.
EXIT.
ENDIF.
IF L_INTERN[] IS INITIAL.
FORMAT COLOR COL_BACKGROUND INTENSIFIED.
WRITE : / 'No Data Uploaded'.
EXIT.
ELSE.
SORT L_INTERN BY ROW COL.
LOOP AT L_INTERN.
MOVE L_INTERN-COL TO L_INDEX.
ASSIGN COMPONENT L_INDEX OF STRUCTURE P_TABLE TO <FS>.
MOVE L_INTERN-VALUE TO <FS>.
AT END OF ROW.
APPEND P_TABLE.
CLEAR P_TABLE.
ENDAT.
ENDLOOP.
ENDIF.
ENDFORM. " UPLOAD_XLSFILE
*& Form SPLIT_TEXT_TABLE
text
-->P_IT_F64 text
FORM SPLIT_TEXT_TABLE TABLES IT_F64 .
LOOP AT IT_F64 INTO WA_F64.
IF WA_F64+0(1) = 'H'.
SPLIT WA_F64 AT C_HTAB INTO WA_HEADER-INDICATOR
WA_HEADER-BLDAT
WA_HEADER-BLART
WA_HEADER-BUKRS
WA_HEADER-BUDAT
WA_HEADER-WAERS.
CLEAR FLAG.
IF FLAG EQ SPACE.
L_REC = L_REC + 1.
WA_HEADER-RECNO = L_REC.
FLAG = 'X'.
ENDIF.
APPEND WA_HEADER TO IT_HEADER.
CLEAR WA_HEADER.
ELSEIF WA_F64+0(1) = 'L'.
SPLIT WA_F64 AT C_HTAB INTO : WA_ITEM-INDICATOR
WA_ITEM-NEWBS
WA_ITEM-NEWKO
WA_ITEM-WRBTR.
IF FLAG EQ 'X'.
WA_ITEM-RECNO = L_REC.
ENDIF.
APPEND WA_ITEM TO IT_ITEM.
CLEAR WA_ITEM.
ENDIF.
ENDLOOP.
ENDFORM. " SPLIT_TEXT_TABLE
*& Form SPLIT_xls_TABLE
text
-->P_IT_TAB text
FORM SPLIT_XLS_TABLE TABLES IT_TAB .
LOOP AT IT_TAB INTO WA_TAB.
IF WA_TAB-F1 = 'H'.
WA_HEADER-INDICATOR = WA_TAB-F1.
WA_HEADER-BLDAT = WA_TAB-F2.
WA_HEADER-BLART = WA_TAB-F3.
WA_HEADER-BUKRS = WA_TAB-F4.
WA_HEADER-BUDAT = WA_TAB-F5.
WA_HEADER-WAERS = WA_TAB-F6.
CLEAR FLAG.
IF FLAG EQ SPACE.
L_REC = L_REC + 1.
WA_HEADER-RECNO = L_REC.
FLAG = 'X'.
ENDIF.
APPEND WA_HEADER TO IT_HEADER.
CLEAR WA_HEADER.
ELSEIF WA_TAB-F1 = 'L'.
WA_ITEM-INDICATOR = WA_TAB-F1.
WA_ITEM-NEWBS = WA_TAB-F2.
WA_ITEM-NEWKO = WA_TAB-F3.
WA_ITEM-WRBTR = WA_TAB-F4.
IF FLAG EQ 'X'.
WA_ITEM-RECNO = L_REC.
ENDIF.
APPEND WA_ITEM TO IT_ITEM.
CLEAR WA_ITEM.
ENDIF.
CLEAR WA_TAB.
ENDLOOP.
ENDFORM. " SPLIT_xls_TABLE
*& Form SPLIT_CSV_TABLE
text
-->P_IT_F64 text
FORM SPLIT_CSV_TABLE TABLES IT_F64 .
LOOP AT IT_F64 INTO WA_F64.
IF WA_F64+0(1) = 'H'.
SPLIT WA_F64 AT '|' INTO WA_HEADER-INDICATOR
WA_HEADER-BLDAT
WA_HEADER-BLART
WA_HEADER-BUKRS
WA_HEADER-BUDAT
WA_HEADER-WAERS.
CLEAR FLAG.
IF FLAG EQ SPACE.
L_REC = L_REC + 1.
WA_HEADER-RECNO = L_REC.
FLAG = 'X'.
ENDIF.
APPEND WA_HEADER TO IT_HEADER.
CLEAR WA_HEADER.
ELSEIF WA_F64+0(1) = 'L'.
SPLIT WA_F64 AT '|' INTO : WA_ITEM-INDICATOR
WA_ITEM-NEWBS
WA_ITEM-NEWKO
WA_ITEM-WRBTR.
IF FLAG EQ 'X'.
WA_ITEM-RECNO = L_REC.
ENDIF.
APPEND WA_ITEM TO IT_ITEM.
CLEAR WA_ITEM.
ENDIF.
ENDLOOP.
ENDFORM. " SPLIT_CSV_TABLE -
[solved] Remove words from file using a list variable?????
Is it possible with bash, to create a script that will scan a text file and remove words that are set in a list?
I have a file with words like so:
word1
word2
word3
I would like to be able to set script to scan file and remove only the words (and spaces left) that are in a list,
that is inside script. Is this possible???
Last edited by orphius1970 (2010-04-22 12:05:45)sorry I am new to scripting and Have NEVER used sed.
Can you explain a little better?
Ok i tried it and understand a little better. However,
It left space behind. How do I fix that?
Also, how do I get it to save the file with the changes?
Sorry If I seem so noobie
Last edited by orphius1970 (2010-04-22 11:27:18) -
Export DB Names over Multiple Servers into csv file
Hi,
I am a Junior DBA at my company and I am looking at running a query onto specific servers that pulls out the Database Name. I have managed to run that query.
However our company has 50 different Host Servers each with a number of databases on each. What I am looking to do is find a way that I can pull out the database names of all the 50 servers, without going into each individual server. Is this
possible?
I have sa on all of the Databases.
Regards,
Jon Ditchfieldand run select Server Name from sys.databases, it says there is no such column. Am I able to use this column?
Hello Jon,
SSMS adds the server name, but you can get a similiar result with:
SELECT @@SERVERNAME, *
FROM sys.databases
Olaf Helper
[ Blog] [ Xing] [ MVP]
Maybe you are looking for
-
Im going to hong kong do i need an adaptor
As it says above Im going to HK and bringing my 3 year old powerbook. Do I need an adapter to plug my PB into an outlet. It appears it will take the voltage (220) per specs. I have a 0 - 1875 converter but it says not to use it with computers. Any ad
-
INSERTING A RECORD IN THE Z-TABLE USING PBI IN SCREE PROGRAM.
Hi Experts!, I have created a z table with some fields and also I have created the screen for the input. I want to store the the record when I click on Submit button and clear the screen while I click on reset buttons which is prese
-
Delete photo in iCloud photo stream?
Hi, is there a way to delete an individual photo in photo stream in your IOS 5 device?
-
How do we display Pages with drop down one below the other ?
Hi, I am beginner to Financial report 9.3.1 . I have repot mock up where i need to place pages like Time Period , Version etc one below the other with the drop down . How should i proceed to achieve the same ? Thanks & Regards, Vijaya
-
hi, I have one value like EN35430202. I have value range like EN35450201 to EN35450210.I am trying to find whether this value EN35430202 falls in the range of above values like between EN35430201 and EN35430210.How to put this in the select stateme