String Data Compression

Is there a way to take a long string and compress it into a
much shorter string?
Here's an example string, a comma-delimited set of values:
cd,1111-1111-11-1,d120700000a72cbj001c,46808598,60,1,030308,060108
I'd like to shrink it down to a 10-12 character string that a
user can input.
Does anyone know of any tools to perform this?

but if you are sending your users an email - why not include
a simple
link they can click on in the email?
that link would have a url parameter - either your original
full string
or an encrypted one - something like:
http://somesite.com/somepage.cfm?c=cd,1111-1111-11-1,d120700000a72cbj001c,46808598,60,1,03 0308,060108
[in the email tell your users to click on the included link
or
copy/paste it into their browser]
somepage.cfm is your form page - make it insert the #url.c#
variable
into appropriate form field automatically, or parse #url.c#
first and
insert parts of the string into appropriate fields -
basically do
whatever you need to do with that string.
[obviously also include some checks to make sure url.c is
there and is
in correct format and the values it contains are valid]
hth
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/

Similar Messages

  • The "write key" configurat​ion file vi use of "trim string" prior to writing the data can modify any string data written.

    I tried to use the config VIs to record some front-panel settings for later restoration, one of which could be a single space character (part of a string parsing system).
    I soon discovered that whenever I tried to save that single-space value to an INI file, only a null string was saved.
    After doing some digging I discovered that buried in the Write Key vi is a worker vi called Config Data Modify that uses Trim String on the string data before it is written to the file and that's what was eating my string character. I don't know whether this is a bug or a feature but there are at least three ways to fix it.
    1) Assuming you want to leave the library VIs alone, you can pre-process any stings sent to "write key" to replace all spaces with "\20" and then post-process all strings read using "read key" to replace all instances of \20 with spaces.
      and if you don't mind modifying the library VIs, either to save/use under a different name or to stick back into the library in a modified state (caution - can cause problems when you move code to another machine with an un-modified library) then...
    2) You can yank the trim-string out of the Config Data Modify vi and hope that it does not have any undesirable side effects with regards to the other routines that use Config Data Modify (so far I have not found any in my limited testing)
    or
    3)  You can modify the string pre-processing vi, Remove Unprintable Chars, to add the space character to the list of characters that get swapped out automatically.
    Note that both option #1 (as suggested above) and option #3 will produce an INI file data entry that looks like    key="\20Hello\20World\20"   while option #2 produces an entry that looks like   key=" Hello World "
    The attached PDF contains screenshots of all this.
    Attachments:
    Binder1.pdf ‏2507 KB

    Hi Warren,
    there's a 4th option:
    Simply set the "write raw string" input of the write key function to TRUE
    This option only appears when a string is wired to that function!
    Just re-checked:
    I think it's a limitation of the config file format. It's text based and (leading) spaces in the value are "overseen" as whitespaces. So your next option would be to use quotes around your string with spaces...
    Message Edited by GerdW on 05-02-2009 08:32 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Need to convert string data to numbers.

    I have string data that I need to convert to numbers so that I can graph it or perform calculations on it. The data (file attached) is in three columns (tab separated) and is in the format time/double/time (saved as a string with Write haracters to File.) When I try Read From Spreadsheet I get 0.0000 for column 1 and 2.0000 for column 3.
    Attachments:
    testOK.txt ‏1 KB

    Hi,
    I've done this through scan from file, using %s%f%s%s so I get the relative time, numeric, time, PM
    See the attached .vi.
    Hope it helps
    S.
    // it takes almost no time to rate an answer
    Attachments:
    disect_data.vi ‏46 KB

  • Inserting String data to BLOB column

    Hi All
    I want to insert String data into BLOB column using DBAdapter - through database procedure.
    anybody can help?
    Regards
    Albin Issac

    I have used utl_raw.cast_to_raw('this is only a test')).But for bigger string I get the error as "string literal too long" do we have any similar function for longer string.
    Thanks,
    -R

  • Smartform Problem in Displaying a string data

    Hi Friends,
                     I am facing a problem while displaying a string data in smartform. Actually it is a one of the field's data in an internal table. It is a STRING field type of length 0. While populating in an internal table it is having a all the data(Around 700 char data). But while displaying in a smartform surprizingly only few characters(Around 225 char data). How can i overcome this problem?
    Regards,
    Sekhar.J

    Hi
    try this and see
    Declare some Variables of 72 char each and split that long string data of internal table text field into them and display these variables strings one below other in smartform
    var1 = itab-text+0(72)
    var2 = itab-text+72(72)
    var3 = itab-text+144(72)
    like that
    and display one below other in smartform.
    &VAR1&
    &VAR2&
    &VAR3&
    Reward points for useful Answers
    Regards
    Anji

  • Dynamic structure of "string" data type. Please help.

    ABAPers,
    I am calling cl_alv_table_create=>create_dynamic_table method to dynamically create a structure. The input structure definition is as follows:
    data: xfc type lvc_s_fcat.
    data: ifc type lvc_t_fcat.
    * define Fld1
    clear xfc.
    xfc-fieldname = 'Fld1'.
    xfc-datatype = 'string'.
    append xfc to ifc.
    * define Fld2
    clear xfc.
    xfc-fieldname = 'Fld2'.
    xfc-datatype = 'string'.
    append xfc to ifc.
    Although the call to create_dynamic_table does not throw any exceptions, it appears Fld1 and Fld2 are not of "string" data type. I don't know of a way to see what type they are. However, they do have a length limit of 10 characters.
    After some experimenting, it turns out that the method simply ignores "datatype" value if it doesn't understand it and creates the field with some default data type.
    I would appreciate it if someone can show me how to create fields of "string" data type.
    Thank you in advance for your help.
    Pradeep

    That's right, use STRG as the datatype.  Please see the example program.
    report zrich_0003.
    type-pools: slis.
    data: new_table type ref to data,
          new_line  type ref to data.
    data:  xfc type lvc_s_fcat,
           ifc type lvc_t_fcat.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>,
                   <fs>.
    start-of-selection.
      clear xfc.
      xfc-fieldname = 'Field1' .
      xfc-datatype = 'STRG'.
      append xfc to ifc .
      clear xfc.
      xfc-fieldname = 'Field2' .
      xfc-datatype = 'STRG'.
      append xfc to ifc .
    * Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
        exporting
          it_fieldcatalog = ifc
        importing
          ep_table        = new_table.
      assign new_table->* to <dyn_table>.
    * Create dynamic work area and assign to FS
      create data new_line like line of <dyn_table>.
      assign new_line->* to <dyn_wa>.
      assign component 1 of structure <dyn_wa> to <fs>.
      <fs> = 'This is string 1'.
      assign component 2 of structure <dyn_wa> to <fs>.
      <fs> = 'This is string 2'.
      append <dyn_wa> to <dyn_table>.
    * Write the values of internal table.
      loop at <dyn_table> into <dyn_wa>.
        do.
          assign component sy-index of structure <dyn_wa> to <fs>.
          if sy-subrc <> 0.
            exit.
          endif.
          write:/ <fs>.
        enddo.
      endloop.
    REgards,
    Rich Heilman

  • Xy graph in GUI. Show string data related to a X,Y point

    It is possible to show string data, while hovering the mouse or clicking a cursor, attached/related to a X,Y point in a XY graph??
    Kind regards

    I assume you want to let the x-y-value pair hover over the graph at mouse position.Perhaps this will help you:
    http://forums.ni.com/t5/LabVIEW/Text-overlay-annotation-onto-an-intensity-graph/m-p/883438/highlight...
    Another option might be just to use the cursor functionalities of XY graphs, although they don't hover at mouse position.
    Other than that I had a similar request on Image Displays with IMAQ (Vision Development Module) where it turned out that using a simple string control from the classic palette that you move around according to mouse position is an efficient way to let information hover wherever you want. Check it out:
    http://forums.ni.com/t5/LabVIEW/Why-do-overlays-take-so-much-longer-on-single-precision/m-p/2376338#...

  • File Adapter Data Compression

    I'd like to extend file adapter behavior to add data compression features like unzip after read file and zip before write file. I read oracles's file adapter documentation but i didn't find any extension point

    if its java mapping, just create a DT with any structure as you wish.
    ex.
    DT_Dummy
    |__ Dummy_field
    java mapping does not validate the xml against the DT you created

  • Datetime field overflow / String data right truncation

    Hi All,
    Getting the follwing erros while working with timestamp for selecting from or inserting data into DB2 through WebSphere 6.1.
    I am passing values like this: 2006-05-02-21.57.26.744341.
    The queries run fine while executing through some SQL Frontend editor.
    [IBM][CLI Driver] CLI0114E Datetime field overflow. SQLSTATE=22008
    [IBM][CLI Driver] CLI0109E String data right truncation. SQLSTATE=22001
    Please let me know the problem.

    If you are trying to convert to a java.sql.Timestamp as part off the process of inserting into DB2 then Timestamp is derived from java.util.Date which holds the time in milli-seconds but you are providing a microseconds field.
    Could this be the problem?

  • String Data-Loss over Sockets

    I have some code that sends strings through a socket to a C++ program on another machine.
    The test strings I have been using are three characters long (i.e. 6 bytes). The buffer size I have put on the socket is 72 bytes, so I should have no problem writing these strings.
    The first three strings always arrive at the other program fine, BUT after that, only a substring of each string seems to get through. I am absolutely certain that the strings are complete before I send them, because I print it to the screen at the same time.
    I have tried change the style of output stream I use (I have used DataOutputStream, BufferedOutputStream, BufferedWriter, StringWriter, and PrintWriter. It still happens.
    Can anybody tell me why this might happen?
    - Adam

    Without more info it is hard guessing. If you want
    reassurance that it should work, then yes, it should
    work.-(Well that's kinda what I'm looking for. I'm wondering if anybody knows of a reason why a C++ program (running in windows -- btw, not by my choice) would read the string differently than a java program?
    For all the XxxWriter types you used, I hope you
    declared the charset to be one that preserves the
    2bytes/char you expect (UTF-8 and ISO8859-1 aren't).I haven't modified that from whatever default is set. This may be the probelm, I will look into that, thanks.
    You certainly did not use the BufferedOutputStream
    without somehow encoding the characters into bytes,
    so how did you do? I'm not sure (it was last week that I tried it) but I think the BufferedOutputStream has a method writeBytes(String) that I used.
    For DataOutputStream, I hope you
    used writeChar, which guarantees that 2bytes/char are
    send. Nope. I mostly tried to stick with methods that accept a String, so that I was sure that it was sent out in the right format to be read back in as a String. I wasn't sure what the actually format of a String is, when passed through a socket, specifically, if there is a terminating character (I know C uses a \0 to end the string). Is there any additionl info need to write a string to a socket?
    If you did all this, ... well I would not
    fiddle with the socket's buffer size.Sorry, but I may have to maintain a low buffer size, because these strings are not the only things being sent over this socket. Do you think the buffer size is affecting the problem. I wondered, but the buffer size seems more than large enough to send 3 character strings.
    That's all that comes to mind. Did you try netcat
    (aka nc) as a server to make sure the problem is not
    at the receiving end?I haven't tried this yet, but I will if I can't figure this out. Unfortunately, I'm NOT the author of the code that recieves the data, and the guy who is has simply assumed that the problem is my fault (although he's never actually tested his code with the string data being sent before), and is not interested in checking to make sure he's done it right. I tried looking over his code, but he's got the input routine burried in an #include file that I don't have.
    Thanks for the input, Harald. There are a few things there that I will look into.
    - Adam

  • String data to Sign data

    I am using a device where I receive a string data output which has a meaning.
    For example:
    :000000 -0067U 0004 -0578
    :000000 -0067U 0004 -0578
    :000000 -0066U 0004 -0579
    :000000 -0066U 0003 -0579
    :000000 -0066U 0003 -0580
     I need to extract the 9th and 11th character through a string subset.
    I have a question, please the attached VI:
    1. Is it correct extraction method? any other suggestion?
    2. The 9th character actually is the sign of character 11 i.e +(if space) and - (is shown as minus)
    Then I have to take this number for e.g -5  or +5 then use in another calculation but problem is how can I convert the _ and +  from string to the number? then how can I make the 9th and 11th character as one number.
    Attachments:
    string.vi ‏14 KB

    Maybe the last part can be simplified. Please see the image.
    I modified your input a little bit since your data only contained "minus". I changed row 2 to have a "space" which should be interpreted as positive sign. Moreover, row 4 shows a explicit "plus" sign in the ninth position. Note that both space and plus are correctly interpreted as positive.
    Consider sanitizing the input. The 0th-row with "-0587" does not follow the syntax of all the other rows so it should be removed.
    Regards,
    Attachments:
    Solution.PNG ‏24 KB

  • How to send string data through socket!

    Is there any method to send string data over socket.
    and if client send string data to server,
    How to get that data in server?
    Comments please!

    Thank for your kind answer, stoopidboi.
    I solved the ploblem. ^^;
    I open the source code ^^; wow~~~~~!
    It will useful to many people. I spend almost 3 days to solve this problem.
    The program works like this.
    Client side // string data ------------------------> Server side // saving file
    To
    < Server Side >
    * Server.java
    * Auther : [email protected]
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Server extends JFrame
         private JTextField enter;
         private JTextArea display;
         ObjectInputStream input;
         DataOutputStream output;
         FileOutputStream resultFile;
         DataInputStream inputd;
         public Server(){
              super("Server");
              Container c = getContentPane();
              enter = new JTextField();
              enter.setEnabled(false);
              enter.addActionListener(
                   new ActionListener(){
                        public void actionPerformed(ActionEvent ev){
                             //None
              c.add(enter, BorderLayout.NORTH);
              display = new JTextArea();
              c.add(new JScrollPane(display),
                     BorderLayout.CENTER);
              setSize(300, 150);
              show();
         public void runServer(){
              ServerSocket server;
              Socket connection;
              int counter = 1;
              display.setText("");
              try{
                   server = new ServerSocket(8800, 100);
                   while(true){
                        display.append("Waiting for connection\n");
                        connection = server.accept();
                        display.append( counter + " connection is ok.\n");
                        display.append("Connection " + counter +
                             "received from: " + connection.getInetAddress().getHostName());
                        resultFile = new FileOutputStream("hi.txt");
                        output = new DataOutputStream(resultFile);
                        output.flush();
                        inputd = new DataInputStream(
                             connection.getInputStream()
                        display.append("\nGod I/O stream, I/O is opened\n");
                        enter.setEnabled(true);
                        try{
                             while(true){
                                  output.write(inputd.readByte());
                        catch(NullPointerException e){
                             display.append("Null pointer Exception");
                        catch(IOException e){
                             display.append("\nIOException Occured!");
                        if(resultFile != null){
                             resultFile.flush();
                             resultFile.close();
                        display.append("\nUser Terminate connection");
                        enter.setEnabled(false);
                        resultFile.close();
                        inputd.close();
                        output.close();
                        connection.close();
                        ++counter;
              catch(EOFException eof){
                   System.out.println("Client Terminate Connection");
              catch(IOException io){
                   io.printStackTrace();
              display.append("File is created!");
         public static void main(String[] args){
              Server app = new Server();
              app.addWindowListener(
                   new WindowAdapter(){
                        public void windowClosing(WindowEvent e){
                             System.exit(0);
              app.runServer();
    < Client side >
    * Client.java
    * Auther : [email protected]
    package Client;
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Client extends JFrame
         private JTextField enter;
         private JTextArea display;
         DataOutputStream output;
         String message = "";
         public Client(){
              super("Client");
              Container c = getContentPane();
              enter = new JTextField();
              enter.setEnabled(false);
              enter.addActionListener(
                   new ActionListener(){
                        public void actionPerformed(ActionEvent e){
                             //None
              c.add(enter, BorderLayout.NORTH);
              display = new JTextArea();
              c.add(new JScrollPane(display), BorderLayout.CENTER);
              message = message + "TT0102LO12312OB23423PO2323123423423423423" +
                        "MO234234LS2423346234LM2342341234ME23423423RQ12313123213" +
                        "SR234234234234IU234234234234OR12312312WQ123123123XD1231232" +
                   "Addednewlinehere\nwowowowwoww";
              setSize(300, 150);
              show();
         public void runClient(){
              Socket client;
              try{
                   display.setText("Attemption Connection...\n");
                   client = new Socket(InetAddress.getByName("127.0.0.1"), 8800);
                   display.append("Connected to : = " +
                          client.getInetAddress().getHostName());
                   output = new DataOutputStream(
                        client.getOutputStream()
                   output.flush();
                   display.append("\nGot I/O Stream, Stream is opened!\n");
                   enter.setEnabled(true);
                   try{
                        output.writeBytes(message);
                   catch(IOException ev){
                        display.append("\nIOException occured!\n");
                   if(output != null) output.flush();
                   display.append("Closing connection.\n");
                   output.close();
                   client.close();
              catch(IOException ioe){
                   ioe.printStackTrace();
         public static void main(String[] args){
              Client app = new Client();
              app.addWindowListener(
                   new WindowAdapter(){
                        public void windowClosing(WindowEvent e){
                             System.exit(0);
              app.runClient();

  • String data right truncation error

    Hi, what does this message mean?
    Thread id: 14 : Fail to load bulk into DB ERROR in TTCommand.cpp, line 329: Error in TTCmd::Execute() while executing statement
    [TimesTen][TimesTen 7.0.5.6.0 ODBC Driver]String data right truncation
    *** ODBC Error/Warning = 22001, TimesTen Error/Warning = 0
    *** Command execution of statement <insert into TA.TEST values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)> failed.*** Error in TTCmd::ExecuteBatch() : batch of <105> operations failed; only <1> operations succeeded
    Thanks in advance,
    Andrey

    It means what it says. You are trying to insert a string into a CHAR/VARCHAR/NVARCHAR/BINARY/VARBINARY field and the length of the data you are trying to insert is longer than the defined maximum length of a column.
    For example, given a table such as:
    CREATE TABLE T1
    COL1 VARCHAR2(4)
    and the prepared statement
    INSERT INTO T1 VALUES ( ? );
    If I pass 'ABCD' for the parameter then all works fine but if I pass 'ABCDE' for the parameter I get
    22001: String data right truncation
    You need to ensure that no data you pass in exceeds the expected column width.
    Chris

  • [Oracle][ODBC SQL Server Driver]String data, right truncation {01004}

    While importing data from SQL Server 2005 to Oracle gateway 11g Release2, i am getting following error:
    insert into CSDescr select * from CSDescr@sqlserver
    ERROR at line 1:
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    +[Oracle][ODBC SQL Server Driver]String data, right truncation {01004}+
    ORA-02063: preceding 2 lines from SQLSERVER
    Oracle database characterset is AL32UTF8
    SQLServer database characterset is SQL_Latin1_General_CP1_CI_AS
    Following is the configuration in the parameter file for gateway:
    HS_KEEP_REMOTE_COLUMN_SIZE=LOCAL
    HS_NLS_LENGTH_SEMANTICS=CHAR
    I think setting the HS_LANGUAGE parameter shall fix the error but I  want to know what should be the value of this parameter?

    HS_LANGUAGE needs to be set to a character set that is used by the foreign database
    So try: HS_LANGUAGE=american_america.WE8MSWIN1252
    Also specify HS_NLS_NCHAR=UCS2 as the nvarchars of a SQl Server are stored in UCS2 character set

  • About string data type

    Hi
    Maximum number of characters that a string data type accepts in Java.
    Thanks..

    The next may give a rough test.
    public static void main(String[] args) throws Exception{
    int factor= Integer.parseInt(args[0]);
    char[] data = new char[Integer.MAX_VALUE/factor];// note: integer division
    for(int k=0;k<data.length;k++)  data[k]=(char)0x30;
    String s=new String(data);
    System.out.println(Integer.toString(s.length()));
    }

Maybe you are looking for

  • HT3421 I get this error This update requires Mac OS X Tiger 10.4.11 or newer or Mac OS X Leopard version 10.5.6 or newer.

    I need to download this: (http://support.apple.com/kb/DL788) because my macbook wont turn on unless its charged. I did all the resets like VPRAM, SMC, and I forgot the other one. My pack thingy is 0002 and it says that if its 0003 then you dont need

  • File to proxy and proxy to file asynchronous

    Hi Experts Through my scenario I have to send xml files to file system from R/3 and vice versa. I am using Sender is proxy and receiver CC is file and vice versa. Here in R/3 25 tables having 25 different structures and sender and receiver data struc

  • Need to print with out comma

    Hi all, My table is loaded like this 123,678 .00 .I need to extract the data without comma like this 1234678.00 can any one help me to resolve this issue? Thanks in advance.

  • Error in lsmw for t-code QP01

    Hi Experts, Iam uploading data through LSMW for QP01 but in the second last step that is create batch input session its giving me this error "No profile with entry tool for task list / / / in session QP01" can anyone help to get rid of this error. pl

  • What is the best way to setup network so its FASTEST?

    Hello, I have an old airport plugged into my cable provider box, and use one macbook pro core duo on it, and one new imac on it. But lately i transfer from the internet a lot of big files, and i wan't the fastest network connection for my imac. Shoul