Saving an array of multi-line text cells in a format that can be read in later

I can create an array of multi-line text entries that my program can then pick cells and compile them into a list of text.
I would like to be able to Save the array as a file, then change my program to read in the file.
If I use the Save Spreadsheet file vi, the data is corrupted by the carriage returns within the cells and the data read in is messed up.
Can someone recommend a way to save the array that preserves the carriage returns?

As far as I know, this cannot be done automatically with the basic VIs from the palletes.  I would convert the [LF] into another group of characters (likely "\n") and then save the text array to a CSV file.  Don't forget to escape any good "\" string with an extra "\.  Regular expressions would work really well:
Just make sure you parse your entire array of strings with this.
Olivier
Attachments:
SaveToCSV_WithMultiLine.vi ‏9 KB

Similar Messages

  • Need to format a vpn log text file into a format that can be written directly to a SQL table

    I am trying to do two thing inside of powershell
    1. Take a vpnlog text file  "C:\temp\ps3\vpnlogs\testlog.txt" formatted as such and be able to directly add the columns to a sql table
    "Number" "Date" "Time" "Interface" "Origin" "Type" "Action" "Service" "Source Port" "Source" "Destination" "Protocol" "Rule"
    "Rule Name" "Current Rule Number" "User" "Information" "Product" "Source Machine Name" "Source User Name"
    "291" "29Nov2013" "23:59:00" "" "A*****" "Log" "Log In" "" "" "111.*.*.* " "A*****" "" "" "" "" "pet*******"
    "VPN internal source IP: 192.*.*.*; reason: disconnected from gateway" "Security Gateway/Management" "" ""
    2. Remove the empty colums in this text file so that I can then find a way to upload only colums that have a column name directly up to the sql table via a powershell script .
    SO basically import txt file format it into colums that have data that can then be directly written to a sql table without me having to manually create the columns in the table. if this worked correctly the sql table would be uploaded with the colums and
    data from sql.
    I can do the upload portion with the below listed powershell command however when I import the following file into powershell I have to manually import the testlog.txt into excel then save as a csv to upload... not to mention I had to
    manually create the columns in the sql table so that it imports correctly.
    get-content "C:\temp\ps3\vpnlogs\testlog.txt" I can not get the data to format correctly without manually importing it into the logfiledata.csv.
    $dt=Import-Csv-Path"C:\temp\ps3\vpnlogs\logfiledata.csv"|Out-DataTable
    Write-DataTable -ServerInstance"myserver"-Database"mydata"-TableName"dbo.VPNLOGS"-Data$dt
    I also have tried this to format the text file but it's not working the way I thought it should, but I don't want to have to create the .CSV file if I can avoid it I would rather take the data in powershell formatted and use the colums to
    get-content"C:\temp\ps3\vpnlogs\testlog.txt"|Foreach-Object{
    ($_ 
    -replace'"',',')
    } |Set-Content"C:\temp\ps3\vpnlogs\testlog2.csv"
    | Import-Csv
    "C:\temp\ps3\vpnlogs\testlog2.csv"|selectNumber,date,time,interface,origin,type,action,service,"source
    port",source,destination,protocol,rule,"rule
    name","current
    rule number",user,information,product,"source
    machine name","source
    user name"
    "Number" "Date" "Time" "Interface" "Origin" "Type" "Action"
    "Service" "Source Port" "Source" "Destination" "Protocol" "Rule" "Rule Na
    me" "Current Rule Number" "User" "Information" "Product" "Source Machine Name" "Source User Name"
    "473" "4Dec2013" "23:59:01" "" "AAMESXF604" "Log" "Log In" "" "" "ip72-198-30-53.ok.ok.cox.net" "AAMESXF604" "" "" ""
    "" "usthompst"

    Thank you Mjolinor this seems to have given me a good output, now do you know of a method using the out-datable  and write-datatable that I can use to directly upload the objects and data. Really I do not want to have to create another file at this
    point I would like to take all of this info and now write it directly to my SQL-Table...
       TypeName: Selected.System.Management.Automation.PSCustomObject
    Name                MemberType   Definition                                                                                       
    Equals              Method       bool Equals(System.Object obj)                                                                   
    GetHashCode         Method       int GetHashCode()                                                                                
    GetType             Method       type GetType()                                                                                   
    ToString            Method       string ToString()                                                                                
    Action              NoteProperty System.String Action=Log In                                                                      
    Current Rule Number NoteProperty System.String Current Rule Number=                                                               
    Date                NoteProperty System.String Date=4Dec2013                                                                      
    Destination         NoteProperty System.String Destination=******                                                          
    Information         NoteProperty System.String Information=VPN internal source IP: *.*.*.*; reason: disconnected from gateway
    Interface           NoteProperty System.String Interface=                                                                         
    Number              NoteProperty System.String Number=473                                                                         
    Origin              NoteProperty System.String Origin=********                                                                  
    Product             NoteProperty System.String Product=Security Gateway/Management                                                
    Protocol            NoteProperty System.String Protocol=                                                                          
    Rule                NoteProperty System.String Rule=                                                                              
    Rule Name           NoteProperty System.String Rule Name=                                                                         
    Service             NoteProperty System.String Service=                                                                           
    Source              NoteProperty System.String Source=ip*-*-*-*.ok.ok.cox.net                                                
    Source Machine Name NoteProperty System.String Source Machine Name=                                                               
    Source Port         NoteProperty System.String Source Port=                                                                       
    Source User Name    NoteProperty System.String Source User Name=                                                                  
    Time                NoteProperty System.String Time=23:59:01                                                                      
    Type                NoteProperty System.String Type=Log                                                                           
    User                NoteProperty System.String User=*******  

  • Displaying a multi-line text block in an ALV grid cell

    Can I display a multi-line text block (i.e. a paragraph of text) in an ALV grid cell?
    If yes, what properties do I set in the Field Catalaog (I tried the style and that didnt seem to work)
    Thanks

    By default ALV Grid merges fields with same values vertically.
    Isn't that only when the column is part of the sort key? You also have to consider the user changing the sort sequence, which can make the text jumbled up. In one of my reports I have made the cell a hotspot and displayed the text in a popup. Of course you cannot print it.
    Cheers,
    Ramki.

  • Permanently save line spacing in a multi-line text field

    Me: Adobe Acrobat 8 Pro, Windows Vista
    (I think the people who will be using the form have Reader 7 on Windows)
    I work in a doctors' clinic, and we use phone message sheets to document conversations between the patients/us/nurses/doctors, and I scanned the form and made it into a fillable PDF for our secretaries to fill out more quickly. The "message" area has pre-printed lines on it, and the multi-line text field I placed there needs to match up to the lines. I used the Rich Text Formatting options to set it to "Exactly 24 Points," but I can't get it to KEEP the formatting permanently. The only way I could get it to save the formatting in that field was to put a space in it and then save it, and then give that to the 2 phone secretaries. It works perfectly the first time, but instead of just closing/re-opening the file to start a new message, one of the secretaries highlights everything in the "message" field and deletes it... which deletes the line spacing formatting. I've told her
    b numerous
    times to leave that starting space in the field, but she "forgets" so all of her messages look messed up. So is there a way to force that line spacing
    b PERMANENTLY
    ???? Here's a shrunken screenshot of the field -- I wish I could just erase the lines altogether so the spacing wouldn't matter, but the secretaries type/print the message out, then the nurses/docs write on the page with pen so the lines have to stay. http://img187.imageshack.us/my.php?image=notepreviewph8.jpg
    Thanks!

    You can set the font size of the text. Then play with the underlines in the original document to match the needs of the font that is used. Print to a new PDF and then use replace pages to put the new page into the form without changing the form fields. I was able to do this with a word processing document by adding underlining in the document with 12 pt and setting the font to 12 pt in the text field. You can play with the font, the border of the field, and the underlining in the original document to get the desired result. Is this optimal, probably not. However it does the job.

  • Multi Line Text Custom Field

    Multi line text custom field is not coming in ms project Professional

    Pradeep,
    You cannot access Multiline text fields from Project Professional and in Project Server Views. These fields are for use in Project Details pages and with workflow for demand management in Project Server. Please refer to the article shared in earlier post.
    I would recommend you to create a Excel/SSRS report if you would like to show data available in this fields to end users.
    Hope this helps.
    ===================================================
    Thank you,
    Kiran K.
    If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful

  • Printing all text in a multi-line text field??  Can it be done?

    I was wondering if there is a way to print out a multi-line field and have all text entered print as well.  Currently, anytime someone enters more information in a multi-line text field on our form than is set to show without scrolling, when a PDF is created for printing from the results page, only the text that fits within the specified size prints.  You can scroll within the PDF and read it all, but I can't seem to figure out how to get all of the text to show and have that field resize accordingly on the printed copy.
    Is there a way?  Thanks.

    Is there an easy way to determine the character count that is visible in a given multi-line text field when designing the form, so if I want to allow 500 characters, the text box I create is large enough for 500 characters?  Obviously I can just do a trial and error process using a cut and paste of 500 characters and testing it, but is there an easier way?

  • New lines created in excel when displaying multi-line text item value

    Hi all,
    I put the value of a multi-line text-item into a csv file :
    DECLARE
    file_filter VARCHAR2(256) := 'Export Files (*.csv)/*.csv/All Files (*.*)/*.*/';
    fExp VARCHAR2(256);
    in_file Text_IO.File_Type;
    linebuf VARCHAR2(4000);
    BEGIN
    fExp := get_file_name ( directory_name, file_name, file_filter, NULL, SAVE_FILE, TRUE);
    IF fExp IS NOT NULL
    THEN
    set_application_property(cursor_style,'BUSY');
    in_file := Text_IO.Fopen( fExp, 'W');
    linebuf := NVL(:com_bnc_possibles.LIBEL_TRAITE,'') || ';' ||
    NVL(:com_bnc_possibles.NUM_ANFR_ID,'') || ';' ||
                             NVL(:com_bnc_possibles.ver_fiche,'') || ';' ||
                             NVL(:com_bnc_possibles.titre,'') || ';' ||
    NVL(to_char(:com_bnc_possibles.date_creat, 'dd/mm/yyyy'),'') || ';' ||
    NVL(to_char(:com_bnc_possibles.date_valide, 'dd/mm/yyyy'),'') || ';' ||
    NVL(:com_bnc_possibles.LIBEL_STATUT,'') || ';' ||
    NVL(:com_bnc_possibles.label_reg,'') || ';' ||
    NVL(:com_bnc_possibles.nom,'') || ';' ||
    NVL(:com_bnc_possibles.prenom,'') || ';' ||
    NVL(:com_bnc_possibles.nom_societe,'') || ';' ||
    NVL(:com_bnc_possibles.comp_bnc,'') || ';' ||
    NVL(:com_bnc_possibles.motifs,'') || ';' ;
    Text_IO.Put_Line( in_file, linebuf);
    Text_IO.Fclose( in_file);
    set_application_property(cursor_style,'DEFAULT');
    END IF;
    END;
    And when I opened the csv file then the remaining lines , that is from the second line , of the column "motifs" are displayed through the column A of excel. The "motifs" multi-line text-item has 500 as its Maximum Length property value, and has a Char Data Type property value.
    So how to display all the motifs' lines through the same column M without displaying the remaining lines in column A ?
    Or are there tips to remove CHR(13) characters from a multi-line text-item ?
    Thank you very much indeed.
    Message was edited by:
    andrianiaina

    Hi,
    I tried to do it in different way. What i did is I have created a item of type formattted text and set its text like:--
    <html>User authentication failed. <br*> Cause: Invalid password.</html> --remove *
    So I am able to see the prompt like :-
    User authentication failed.
    Cause: Invalid password.
    Hope this helps you...
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to add multi-line text in comments field of song tags in iTunes 12?

    Recently upgraded to iTunes 12 and can no longer enter multi-line text in the comments field of a song tag.  Used to use option+return (alt+enter) to go to a new line (carriage return).  Can it still be done?  Any help in this regard would be appreciated.

    See my other post for the solution to this problem.

  • Hello All. I am working on a form, but I need to format the leading in a multi-line text-field.

    Hello All. I am working on a form, but I need to format the leading in a multi-line text-field. The options for the text-field only show a font size option, but no other styling options. Is there a way to format the leading? Thanks!

    Not within ID, and I'm not sure it can be done in Acrobat afterward either.

  • Multi Line Text In javaFx

    How can i create multi Line Text In javaFx.
    There is any Method or something else.
    thanx in advance

    Use a TextArea control? Or does this not meet your needs?

  • Displaying Multi Line Text

    Hi,
    I am having issues in displaying multi line text on a Text Item. Basically there is data in the database column DetailText which is stored like this with carriage returns :
    If I look at the column in Toad it is formatted with all the carriage returns correctly eg.
    Hello
    World
    When I display this in my StaticStyled Item it displays like "Hello World" in one line. I want to be able to display it as it is with the carriage return on 2 seperate lines.
    I have looked in this forum and one search 2 places and one suggestion was to use RawText Item type. I have tried changing the Item Type to Raw Text and FormattedText but it doesn't make any difference. The lines are still displayed horizontally instead of vertically. Another place I saw was to use OAHTMLWebBean but doesn't show how I can do this.
    This should be simple enough but I have searched the DevGuide and this forum and couldn't figure out the solution. Any help would be appreciated.
    Thanks

    Hi,
    I tried to do it in different way. What i did is I have created a item of type formattted text and set its text like:--
    <html>User authentication failed. <br*> Cause: Invalid password.</html> --remove *
    So I am able to see the prompt like :-
    User authentication failed.
    Cause: Invalid password.
    Hope this helps you...
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Is there a proper way to config multi-line text boxes so they're compatible with all/most browsers?

    I've got forms that use multi-line text-boxes and they work fine with IE and Chrome.  A user just discovered that in Firefox the fields don't wrap (it basically appears to be a large field but acts like a single-line).
    Is there a workaround/fix for this?

    Is the input text just some dummy text line e.g. "aaaaaaaaaaaaa...." without any spaces? Try by adding lorem ipsum sample text i.e. actual words with spaces between. It should wrap.
    Thanks, Ransher Singh, MCP, MCTS | Click Vote As Helpful if you think that post is helpful in responding your question click Mark As Answer, if you think that this is your answer for your question.
    Firefox 37.01 —Here's a screenshot of it not wrapping:
    (each of the above are 2 long paragraphs that are not wrapping and showing as 2 single lines.)
    And here's a screenshot of Text Box Properties (I've tried it with and without autocomplete and spell-check just for kicks).

  • Set the number of lines allowed in multi-line text field

    Hi,
    I am designing a form where I have some multi-line text fields where I only want the user to be able to enter a maximum of say 5 lines. I know I could do this by enabling the "Limit Length to Visible Area" option, however, this option is ignored by Reader 7 and the field scrolls, hiding any text that spills beyond the visible area from printouts. It works great in 8 though. To avoid this bug/feature in Reader 7, is there some script that I can use to limit the number of lines allowed in a text field?
    Thanks

    I ran into similar issues switching between Acrobat/Reader. Here is the prominent code that works for me when I use this in "Enter" event of the textField.
    var aSOM=this.somExpression.substr(15,this.somExpression.length - 1);
    var acroField = event.target.getField(aSOM);
    acroField.doNotScroll = true;
    I chose Allow Multiple Lines alone and noting else.
    Good Luck,
    SekharN

  • Can Captivate 5 support multi-line text boxes?

    A colleague is trying to add a text box, where the user will need to enter multiple lines...  We don't want word wrap, we actually want the user to be able to add carriage returns and additional lines...  Is that possible?
    If the text box element can't do multiple lines, is there a way to accomplish this using a different canned element? (non-klunky, I've read the 3-year-old thread on this topic.)
    Thanks in advance

    From: Josh_Corey
    Sent: Sunday, January 26, 2014 10:05 PM
    To: KJ Therine
    Subject: How to print multi line text boxes
          Re: How to print multi line text boxes
          created by Josh_Corey in FormsCentral - View the full discussion

  • Converting a multi-line text to one-line

    Hi
    I have a problem with a multi-line text, to be converted to one line, which I take from a JEditorPane.
    I tried several things but it is still multi line
    // the text is taken from JEditorPane
    String str = jeditorPane.getText();
    // replace "\n" with " "
    str.replaceAll("\\n", " ");or
    // the text is taken from JEditorPane
    String str = jeditorPane.getText();
    Scanner s = new Scanner(str);
    String line;
    String completeText="";
    while( ( line = str.nextLine() ) != null  ){
          completeText += line + " ";
    }In the fist code, it replaces all the "\n"'s with a space but it is still multi-line
    in the second one, it doesn't change anything
    So, what is wrong with these codes?
    p.s. In the second code there (may) be a little mistake causing compile time error, please ignore that, my problem is with the logic of the code
    thanks

    How do you know that the string is still multi-line after you have executed replaceAll? Have you tried to also remove all \r in the text?
    Kaj

Maybe you are looking for