Read a spreadsheet and replace spaces

I am using a cfspreadsheet tag to read excel file. Since, I am using QoQ, the file import errors out since the header row has spaces in it?
How do we read the header row specifically and replace spaces and save the file before moving forward? Thanks
<cfspreadsheet action="read" src="c:\WellRecords.xls" query="qryRecords" headerrow="1" sheetname="1">

I am using a cfspreadsheet tag to read excel file. Since, I am using QoQ, the file import errors out since the header row has spaces in it?
How do we read the header row specifically and replace spaces and save the file before moving forward? Thanks
<cfspreadsheet action="read" src="c:\WellRecords.xls" query="qryRecords" headerrow="1" sheetname="1">

Similar Messages

  • CS5(js) script to read a spreadsheet and create a document

    I need to write a script to read a csv file and create pages on an InDesign file.(a data merge) However after it creates the pages I need it to change the objects on the page based on the information on that line of the spreadsheet. After all the changes are made each page needs to be exported as a PDF and named a specific name from the spreadsheet. I am not even sure this can be done much less where to start.... any help would be greatly appreciated.
    Thanks TJ

    It can be done.
    I have done some similar stuff earlier, and have some functions that might be useful. I did not script the data merge itself, but that should be possible as well.
    I made this function for exporting separate PDFs after a data merge. It had some logic to give files clever file names based on the contents of a certain text frame. So that can be implemented.
    function eksportMerged(numberOfPages){ // exports the document into several pdfs with [numberOfPages] pages each.
         var myDoc = app.activeDocument;
         var allPages = myDoc.pages.length;
         var numberOfPDFs = Math.floor(allPages/numberOfPages);
         var mappe = new Folder;
         mappe = Folder.selectDialog("Export "+myDoc.name+" to which folder?");
         var filestart = "File_number_";
         var filename = "";
         var myFile;
         var eksportrange = "";
         for (var n = 0; n< numberOfPDFs; n++){
              filename = filestart+("00"+(n+1)).slice (-3)+".pdf";
              myFile = new File(mappe.fullName+"/"+filename);
              eksportrange = (n*numberOfPages)+1+"-"+((n*numberOfPages)+numberOfPages);
              eksportPDF(myDoc,eksportrange, myFile);
         function eksportPDF(dok,page,path){
              var myPDFpref = app.pdfExportPresets.itemByName("[High Quality Print]");
              app.pdfExportPreferences.pageRange=page;
              app.pdfExportPreferences.viewPDF=false;
              try{
                   dok.exportFile(ExportFormat.pdfType, path, false, myPDFpref,"",true);
              } catch(e){
                   throw(e);
    This function will read a CSV and returns an an Array (rows) of Arrays (columns) of Strings (cells). This works with CSVs exported from Google Docs. They have commas as cell separators and newline characters as row separators. Some CSVs use semicolons instead of commas.
    function parseCSV(filePath){ // reads a CSV, returns an array of contents.
         var csvfil;
         var result;
         var fileContent;         
         csvfil=new File(filePath);
         csvfil.open();
         fileContent = csvfil.read();
         csvfil.close();
         eval("result=[['"+fileContent.replace(/,/g, "','").replace (/\n/g, "'],['")+"']];");
         return result;

  • Search and replace all spaces between quotes with uderscore

    Hello,
    I'm new on Powershell and I'm trying to make the script that:
    searches over file and replaces all the spaces which have been found between quotes;
    removes all quotes (except these which has not value eg "").
    For example:
    Source file:
    string3=string4 string="string1 string2 string23" string8="" string5="string7 string8"
    Destination file:
    string3=string4 string=string1_string2_string23 string8="" string5=string7_string8
    I have been created script that searches the data correctly
    $file="c:\scripts\mk.txt"
    $data=Get-Content $file
    $1
    $regex = [regex]@'
    (?x) # ignore pattern whitespace option
    (?<test>(["'])(?:(?=(\\?))\2.)*?\1)
    $data |% {
    if ($_ -match $regex){
    new-object psobject -property @{
    test = $matches['test']
    }#when adding "|select-object test" I'm getting the correct data
    I have stopped here on search / replace operation (from space to underscore, and by removing the quotes leaving the empty quotes non touched). Can you help me to finish the script?
    Thanks!

    Try this.  It uses the [Regex] Replace static method, with a script block delegate:
    $file="c:\scripts\mk.txt"
    $data=Get-Content $file
    $regex = '(\S+=[^"\s]+)|(\S+="[^"]+")'
    $delegate = { $args[0].value.replace(' ','_') -replace '"(.+)"','$1' }
    $data |% { [regex]::Replace($_,$regex,$delegate) }
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • How do I remove a space before the first word in a sentence using find and replace or GREP?

    Right, so I am laying out a document in inDesign from a word document and it has a space before every first word in a sentence. It is really annoying and I need a quick way to get rid of them. I wasn't too sure how to do it with find/change but I am sure there is a way in GREP if someone can help me. I have included an image so that people can see exactly what I mean.

    The ^ location works for all paragraphs.
    But a note to the OP, there is a sample script called FindChangeByList that removes leading and trailing spaces as well as extra spaces after punctuation, all in one go. But if you want to continue to use a GREP find/change to remove leading space, I'd modify Joel's suggestion to ^\s+ to get those cases where the user typed multiple spaces as well.
    And don't forget there are actually legitimate places for leading tabs, which both the script and this GREP will find and remove, so be careful.

  • Read integer values from spreadsheet and display the values in a table

    Hi all,
    I have integer values to read from a spreadsheet and display them in a table. I am using 'Read from spreadsheet file' in 'integer' mode. I would like to display these values in a table. The problem is that the table takes only 2d-array of string as input but not integer.  
    It works fine if I change the mode of 'Read from spreadsheet file' from 'integer' to 'string' but I want to read integers and have to use the integer values for further calculations. Please give any suggestions on displaying integers to a table.
    Thank you. 
    Solved!
    Go to Solution.

    No don't take element by element just convert as a whole. See the attached example
    Good luck
    The best solution is the one you find it by yourself

  • Wiring write to spreadsheet.vi to read from spreadsheet.vi and plot the data

    I need to plot the data file from the two 'write to spreadsheet.vi' into a graph. Does anyone know how should I connect the 'read from spreadsheet.vi' so that I can plot my data?
    Please refer to the snippets.
    Thanks.
    Attachments:
    read from spreadsheet.png ‏31 KB

    Hi Lynn,
    You're asking the very same question that I've been wondering about because I don't have the time info. I've found an example that have both info, temperature and time in two colums in one file..it uses two Index Array for time and temp, use the bundle feature, display the plot in an XY graph. So, that was an easy one, but apparently my case is different.
    I've a program that collected the data from simulated signals and it is plotted in a waveform graph against time (amplitude vs time), and a power spectrum (amplitude vs frequency). But the data that I collected are the RMS values and power spectrum amplitude...so, I'm not sure where the time data go. I need to figure this out.

  • How to read two text files using the Read from spreadsheet.vi and then plot it

    I need to read two text files using the read from spreadsheet function and then plot these files over time.
    The file with the .res extention is the RMS values (dt and df) and the second file contains the amplitude of a frequency spectrum.
    I really appreciate any help..thanks
    Attachments:
    RMS.txt ‏1 KB
    FREQUENCY.txt ‏1 KB

    From NI Example Finder:
    Write to Text File.vi
    Read from Text File.vi
    Jean-Marc
    LV2009 and LV2013
    Free PDF Report with iTextSharp

  • How to read an html file and replace a text using text_io

    hi,
    i want ro read an html file using text_io and replace a particular text with a new text
    eg: i want to replace a text called "data.js" and with "maps.js"
    how do i do this?

    You have to write your own code to do that. TEXT_IO is just a low level text file interface.
    You need to read in all the text, save it in some internal format (array of varchar2's maybe or in the DB) and then perform a search on the text you have read in, find out where the instances of "data.js" are located and substitute them with "maps.js" After that you need to write to a new file and delete the old one. There is no way to search and replace inside the existing file (what's sometimes referred to as 'in-place' substitution).
    See the help section called About the TEXT_IO package for an overview of how it works and some code examples.

  • PB Reader 8.1 and Elements 6.0 cannot open file if path contains space ???

    Hello,
    We encountered a problem between Adobe Reader 8.1 and Elements 6.0
    The problem appear when the VIEW PDF FILE option is enabled in PDFMakers options and ESPECIALLY if the path where the file has been saved contains a space.
    Is there a patch to resolve this malfunction ?
    If not, is there any way to disable the VIEW PDF FILE option for all users and default user ? (script, batch or registry file)
    (The Install Shield Tuner for Acrobat 6 do not permits to have an effect on this parameter.)
    Thank you for responses

    Alexander,
    I'm having a similar problem, but with a Flash file.
    I've verified that I can play the file from the
    command line and from my KDE Desktop (SUSE Linux 10.1),
    and so I'm pretty sure that the player is working.
    But when I generate a PDF using LaTeX and your movie15
    package AR8.1.1 redirects me to:
    http://www.adobe.com/special/acrobat/nomediaplayer.html
    If I look at the attachments pane, the file is
    correctly identified as "application/x-shockwave-flash"
    But under the filename, the phrase "Indeterminate" has
    been added, which suggest that the something in the
    annotation is not recognized (I'm using move15 2007/05/07).
    Either that, or AR itself is broken.
    I'm still in the process of dissecting the PDF to see
    where the problem lies. But it would be helpful if
    someone could post a url to an embedded media example
    that is known to work with Linux AR8. That way I can
    at least check that my setup is working, which will
    be hakf the battle won.
    Cheers,
    James

  • Suppress Underscore and replace with Space in FR

    Hi
    Hyperion Financial Reporting 11.1.2.1
    In the excel, with a Essbase add-in, we have an option as Suppress--->Underscore Characters
    This will eliminate the Underscore and replaces with a space
    I want to know if the same functionality exists in the FR Studio
    Any insight would be much appreciated
    Regards
    Tejo jagadeesh

    Sorry, I misread your question. I thought it would be doable though Conditional Format: http://docs.oracle.com/cd/E17236_01/epm.1112/fr_user/ch10s02.html
    Something like this:
    If Member Name > Dimension > contains > _ > Format Cells > Replace >
    But then it replaces the whole member with space which I believe is not something you are looking for.
    One other option is to have another alias table in your database and select the new alias table in FR. I know this is an option for Essbase. I am not so sure about other db connections.
    Cheers,
    Mehmet

  • Getting error code 150110 when installing Reader on Win7 and there is plenty of disk space.  Help!

    getting error code 150110 when installing Reader on Win7 and there is plenty of disk space.  Help!

    Hi pat27,
    Are you still facing this issue?
    Do you have any previous version of Reader installed, if yes and it is 9 or above. Uninstall that using Adobe Reader cleaner tool:  http://labs.adobe.com/downloads/acrobatcleaner.html
    Once that is uninstalled restart your machine and try install again.
    Also you may try to create a new user profile with Admin rights and try to install again.
    - How to create new user profile:: Fix a corrupted user profile - Windows Help
    Regards,
    Ajlan Huda

  • Find and Replace with space or tab

    Hi,
    I have a text file that has commas separating values. I saved it as a csv, but am not getting the results I need with the csv file. I'd like to replace the commas with a space or a tab.
    I know how to use find replace, but I do not know how to indicate these non-printing characters. I tried the ascii code &#32 for space, but i simply get that string of characters replacing my commas.
    ANy help?
    Thanks

    KW,
    You didn't say what program you were using for the Find and Replace, but I'd suggest that Pages would be your best bet. Spaces can be typed-in directly, and several other non-printing characters can be inserted from a drop-down menu.
    The Insert drop-down seems to be available only in Pages, as opposed to Numbers and TextEdit.
    Jerry

  • I can't fix my current version of Reader 8.1 and I can't seem to be able to replace it.

    My current version 8.0 of reader keeps blowing up whenever I try to use a PDF function. It kicks me out of the net when I try to call up any data in a PDF format.  I tried several times to install a newer version but kept triping over a msg "Action File Not Found".  I tried the solution listed online for that and drew a
    blank as well. Now all I get is the lame  "Encountered Problems". 
       I have managed to get as far on the install routine of retriving the download and I tell the program to
    run and continue to get thrown out.
       What I'm looking for here is anyone who has gone thru this and broken thru the online standard canned solutions and got something that worked from a "live" expert.

    You need to uninstall your current Reader, then download and run the offline installer from http://get.adobe.com/reader/enterprise/

  • Read from spreadsheet

    Hello,
    I'm having strange issues trying to read from the following spreadsheet file. I'm using a similar structure for 2 other spreadsheet files and they work perfectly. When I try and use the following VI with the attached data file it just seems to import a load of zeros.
    I'm wondering if the issue could be related to the delimiter as the data is not just comma separated values but there seems to be a space directly after the comma i.e. "18.63, 18.23, 17.53" as opposed to "18.63,18.23,17.53".
    Can anyone help me with this? I'm just trying to get some temperature sensor data from a datalogger. The data is being written to the spreadsheet continually and I'm just trying to read the most recent value so that I can use it for further calculations.
    Thanks in advance,
    Barry
    Solved!
    Go to Solution.
    Attachments:
    Data 8199 2391 4_22_2015 16_40_38 1.csv ‏14 KB
    Read spreadsheet data.vi ‏10 KB

    Right click on your indicator and display \codes mode.  You'll see \00 every other character.  Even in normal display, the text doesn't look right with "spaces" between every character.
    I think it is somehow encoded as unicode.  I think that is what the \FF\FE at the front of the file signifes.
    Excel is probably reading a unicode CSV file okay.  LabVIEW reads it as a straight up "text" file with a bunch of null characters all over the place.
    If you use search and replace, to replace the null characters with nothing, it works fine.
    See the attached snippet.
    Attachments:
    Read spreadsheet data.png ‏115 KB

  • Using applescript for Find and Replace All in Pages 2.0

    i saw that Pages 2.0 is scriptable
    i try to create a script for merge use to find and replace all occurence of a certain string using a script but Pages doesn't seems to respond to "Find" even using "System Events"
    how can i do to use this function with a script
    Thanx for any help
    S.B.
    ibook G3   Mac OS X (10.4.6)  

    OK, here's another example. This one gets the text as a string and uses the offset property to find "[", presuming it to be a merge delimiter. (Pages' text doesn't support "offset of").
    One failing of this scheme is that the offsets are incorrect if you have inline objects (pictures, shapes, tables, etc.). While it is probably possible to compensate for them, that's a trickier proposition.
    <PRE>-- Example merge replacements:
    property mergeText : {"[name]", "John Smith", "[address]", "1234 Anystreet"}
    on lookup(mergeWord)
    set theCount to count of mergeText
    repeat with x from 1 to theCount by 2
    if item x of mergeText = mergeWord then
    return item (x + 1) of mergeText
    end if
    end repeat
    -- If merge field is not found, delete it (replace it with the empty string)
    return ""
    end lookup
    tell application "Pages"
    repeat
    tell body text of document 1
    -- Get text as a string so that "offset of" can be used.
    set allText to it as string
    set startOffset to offset of "[" in allText
    if (startOffset = 0) then
    exit repeat
    end if
    set endOffset to offset of "]" in allText
    select (text from character startOffset to character endOffset)
    end tell
    set mergeWord to contents of selection
    tell me to lookup(mergeWord)
    set replacement to result
    set selection to replacement
    if (replacement is "") then
    -- Get rid of extra whitespace (space or return)
    -- Do it in a "try" block to handle edge cases at start or end of text.
    try
    set theSel to (get selection)
    set ch1 to character before theSel
    set ch2 to character after theSel
    if ((ch1 is " " or ch1 is return) and (ch2 is " " or ch2 is return)) then
    select character after theSel
    delete selection
    end if
    end try
    end if
    end repeat
    end tell</PRE>
    Titanium PowerBook   Mac OS X (10.4.6)  

Maybe you are looking for

  • Quicktime movie does not work on hosted iWeb website

    Problem: I have a media file portion on my iWeb designed website that displays pictures (working very well) and one that is supposed to show a movie (not working at all). The movie was made with iMovie and has an .m4v extension. When you click on the

  • Purchase Order - Message Output

    Hi , I am creating Purchase Requisition and converting to Purchase Order using ME59 . In this process system is not generating any output message for PO printing automatically . If i create a PO manually using ME21N , then Output Message condition is

  • Problem about importing class

    Hello, i have this code. <!-- NameProject.mxml --> <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns:my="components.*" width="100%" height="100%"> <mx:Script> <![CDATA[ import lib.User; public var

  • Cinelerra 1.2.2 success!?

    i couldnt sleep tonight, so .... with some help from http://www.funix.org/fr/linux/montage.htm i have now a working cinelerra package. First here comes the PKGBUILD: #Contributor: Rene Thümmler <[email protected]> pkgname=cinelerra pkgver=1.2.2

  • Converting scanned PDF to Excel

    I have tried to convert a scanned PDF to Excel but find the columns and rows are all jumbled and do not reflect the original document. I am using a Mac with MS Office 2011 Any help appreciated. KJ