Dos2unix

This is related to the age old question of moving files from DOS to Unix. There used to be a command dos2unix that included a number of options (-k and/or -U) that permitted the DOS carriage returns to be removed WITHOUT changing the file creation date.
The only current reincarnation of dos2unix only takes in the filename as an argument.
Any suggestions or pointers to a script, etc. would be greatly appreciated.

You may want to post your question in the Unix discussions:
http://discussions.apple.com/forum.jspa?forumID=735

Similar Messages

  • Dos2unix doesn't convert some RDF files to BINARY...

    Hi,
    I have a peculiar issue with a couple of RDF's.
    My scripts copies all the files to a temp directory; move them to the relevant tops/paths and then do a "dos2unix" on the RDF and RTF files.
    Majority of the reports work fine when this is done.
    But this doesn't work fine for 2 RDFs.
    1) I have customized AR Customer Invoice program (RAXINV_SEL.rdf).
    Once i run the installation scripts, it copies everything and does a dos2unix on RDF and RTF files. I can see the custom RDF (XX_RAXINV_SEL.rdf) in $CUSTOM_TOP/reports/US directory.
    It doesn't even throw any error when i run the below command in the Custom_Top.
    [chundurk-DEV]/u01/oracle/EBSDEV/apps/apps_st/appl/xxabc/12.0.0/reports/US > dos2unix XX_RAXINV_SEL.rdf
    dos2unix: converting file XX_RAXINV_SEL.rdf to UNIX format ...
    [chundurk-DEV]/u01/oracle/EBSDEV/apps/apps_st/appl/xxabc/12.0.0/reports/US >
    But when i run the report, It thows the below error:
    REP-1070: Error while opening or saving a document.
    REP-0110: Unable to open file '/u01/oracle/EBSDEV/apps/apps_st/appl/xxbwp/12.0.0/reports/US/XX_RAXINV_SEL.rdf'.
    When i drag the RDF to $CUSTOM_TOP/reports/US in BINARY Mode using FTP, the report works perfectly fine.
    2) This is happening the same way for one of my custom reports too.
    We've developed about 50-60 reports and all of them work fine, except these 2 reports.
    Please suggest. Thanks in advance for your help.
    Regards,
    Kesava

    Gareth,
    Lets ignore the functionality of migration tool for now; its happening the same when i do it directly using SSH Secure Shell Unix & FTP tool.
    The steps i generally follow to migrate the reports are provided below:
    1. Logged in to SSH Secure Shell Unix & FTP tool.
    2. Created a temporary folder say 'reports' in /home/user directory.
    3. Drag all the report files to /home/user/reports directory in default mode i.e., ASCII (Migration tool ClearQuest also does the same).
    4. Then provide permissions on these files:
    chmod 755 *.*
    5. Run the shell Script:
    090xxbwp_inv_mov_apps.sh apps apps ghoord01:1521:EBSDEV.
    Shell script just has the commands shown below:
    1. cp -f 090XXBWP_INV_MOV.rdf $XXBWP_TOP/reports/US/XXBWP_INV_MOV.rdf
    cp -f 090XXBWP_INV_MOV.rtf XXBWP_INV_MOV.rtf
    2. FNDLOAD $1/$2 O Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct 090XXBWP_INV_MOV_CP.ldt - CUSTOM_MODE=FORCE
    FNDLOAD $1/$2 0 Y UPLOAD $XDO_TOP/patch/115/import/xdotmpl.lct 090XXBWP_INV_MOV_XML.ldt - CUSTOM_MODE=FORCE
    3. dos2unix $XXBWP_TOP/reports/US/XXBWP_INV_MOV.rdf
    dos2unix XXBWP_INV_MOV.rtf
    4. chmod 755 $XXBWP_TOP/reports/US/XXBWP_INV_MOV.rdf
    chmod 755 XXBWP_INV_MOV.rtf
    5. XDOLoader command to attach the RTF File to XML Template Skeleton.
    Once this is done; It works perfectly fine for all the reports (RDF's), except two of them.
    For the two reports that doesn't work; it thows the below error when the report is ran in APPS:
    REP-0110: Unable to open file 'XXBWP_INV_MOV.rdf'.
    REP-1070: Error while opening or saving a document.
    REP-0110: Unable to open file '/u01/oracle/EBSDEV/apps/apps_st/appl/xxbwp/12.0.0/reports/US/XXBWP_INV_MOV.rdf'.
    Workaround currently in Use:
    Transfer the RDF file manually in BINARY MODE to $XXBWP_TOP/reports/US directory and the issue is resolved.
    Request you to let me know if you can provide me with any permanant solution for this.
    Thanks,
    Kesava

  • R12 Install Error: how to check stage area by MD5SUM / dos2unix

    Hi,
    I am facing R 12 Install Error at Stage 3 to 5 at 92%... Windows Xp SP3
    I have searched alot through this forum and resolved most of erros but for this error i found Hussein Sawwan always telling other users to run md5sum checksum for stage area integrity and i do the same thing but my md5sum command failed for all lines with error: ": *FAILED open or read*"
    How do i try to make it a unix file using: dos2unix <checksum file> <checksum file> ?
    Just give example commands for dos2unix <checksum file> <checksum file>.
    One more thing,
    I have downloaded Zipfilles for R 12.1.1 edelivery.oracle.com and when i run the sript file in rapidwiz folder *.PL Command window appers copy StartCD in the directory where is specify then a messages comes to insert CD/DVD for rdmsDB !!!
    What i do i m not using any CD/DVD ...??
    Please,
    Help me Any one.

    I have searched alot through this forum and resolved most of erros but for this error i found Hussein Sawwan always telling other users to run md5sum checksum for stage area integrity and i do the same thing but my md5sum command failed for all lines with error: ": *FAILED open or read*"
    How do i try to make it a unix file using: dos2unix <checksum file> <checksum file> ?
    Just give example commands for dos2unix <checksum file> <checksum file>.Please see (MD5 Checksums for R12.1.1 Rapid Install Media [ID 802195.1]) for details.
    One more thing,
    I have downloaded Zipfilles for R 12.1.1 edelivery.oracle.com and when i run the sript file in rapidwiz folder *.PL Command window appers copy StartCD in the directory where is specify then a messages comes to insert CD/DVD for rdmsDB !!!
    What i do i m not using any CD/DVD ...??Unzip the files as per (Using Electronic Delivery With Rapid Install in Oracle E-Business Suite Release 12 [ID 406138.1]) and run md5sum then.
    Thanks,
    Hussein

  • Dos2unix has the wrong default behaviour

    The standard dos2unix package extra/hd2u has the wrong default behaviour - calling it on a file that already has unix line endings flips it to dos. Also, it doesn't install a unix2dos executable at all.
    I've made an upstream request for the author to fix this, but if he decides not to, would it be possible for arch to have postinstall scripts that move the main executable out of the path, and set up dos2unix and unix2dos wrappers that call it with -U and -D respectively? This would keep in line with the expected behaviour of these commands.

    Hello Nolan,
    It is difficult to debug this code without seeing the actual
    XML files. An easy way to see quickly why your conditions are not
    evaluated the way you want is to move them directly in the visible
    part of the option. Then you can see the actual values at the
    runtime and the reasons the expressions evaluated the way they did.
    For example if you have this option:
    <option
    spry:if="'{dswafer_fab_process::p10_wafer_fab_process_rev_status_fk}'
    == '1'" selected="selected" value="1">NEW</option>
    you can quickly debug it like this:
    <option
    spry:if="'{dswafer_fab_process::p10_wafer_fab_process_rev_status_fk}'
    == '1'" selected="selected" value="1">NEW
    '{dswafer_fab_process::p10_wafer_fab_process_rev_status_fk}' ==
    '1'</option>
    Regards,
    Cristian

  • Error while creating Cross-reference table using Xreftool (PIP Ins)

    Error while running xref.sh script unable to create cross reference table.
    **Error: Exception in thread "main" java.lang.NoClassDefFoundError: oracle/tip/xref/tool/AdminTool**
    Could not find xref directory within tip folder (/OracleAS_1/bpel/docs/workflow/oracle/tip)
    searched for similar issue in OTN it says issue fixed by upgrading Oracle AS, we are using 10.1.3.4 MLR#8
    http://kr.forums.oracle.com/forums/thread.jspa?threadID=835446
    steps followed.
    Creating Cross-Reference Tables
    Complete the following procedure to create cross-reference tables.
    To create cross-reference tables
    1 Navigate to the following directory:
    %SOAHOME%/SiebelODOPPIP/scripts/
    2 Open the following file for editing:
    xref.sh
    3 Set the userid and passwd for logging into BPEL console on the appropriate lines.
    4 Set the correct SOA_HOME location on the appropriate line.
    5 Save and close the file.
    6 Make the file executeable:
    chmod +x xref.sh
    dos2unix xref.sh
    7 Change directory (cd) to integration/esb/bin under %SOAHOME%.
    8 Execute ../../../SiebelODOPPIP/scripts/xref.sh.
    I am using SOA suite 10.1.3.3 and getting same error
    Error: Exception in thread "main" java.lang.NoClassDefFoundError: oracle/tip/xref/tool/AdminTool

    Hi Abhijeet,
    please check in transaction FI01, about your data consistencies. You can use this wiki help in terms of Address, it it found any useful facts for you
    Address Checks - Business Address Services (BC-SRV-ADR) - SAP Library

  • OES11SP1 LDAP issue on a node

    Hi,
    I have a 2 node cluster that we have upgraded from OES11 to OES11 sp1 at the beginning of august
    Last week we create a new ressource on the primary node (let's say NODE 1), but when we want to migrate this new ressource to the other node (let's say NODE 2), the ressource became comatose.
    On node 2 what i can see in /var/log/messages is the following
    Aug 20 16:42:17 node2 ncs-resourced: Try LDAP for POOLDATA20_SERVER
    Aug 20 16:42:17 node2 ncs-resourced: LDAP failed: <class 'ldap.SERVER_DOWN'>
    Aug 20 16:42:53 node2 ncs-resourced: Error preprocessing script POOLDATA20_SERVER.load
    Aug 20 16:42:53 node2 ncs-resourced: POOLDATA20_SERVER.load: CRM: Tue Aug 20 16:42:53 2013
    Aug 20 16:42:53 node2 ncs-resourced: POOLDATA20_SERVER.load: /bin/sh: /var/run/ncs/POOLDATA20_SERVER.load: No such file or directory
    Aug 20 16:42:53 node2 ncs-resourced: resourceMonitor: POOLDATA20_SERVER load status=127
    Aug 20 16:42:54 node2 ncs-resourced: Error preprocessing script POOLDATA20_SERVER.unload
    Aug 20 16:42:54 node2 ncs-resourced: POOLDATA20_SERVER.unload: CRM: Tue Aug 20 16:42:54 2013
    Aug 20 16:42:54 node2 ncs-resourced: POOLDATA20_SERVER.unload: /bin/sh: /var/run/ncs/POOLDATA20_SERVER.unload: No such file or directory
    Aug 20 16:42:54 node2 ncs-resourced: resourceMonitor: POOLDATA20_SERVER unload status=127
    I try to change the configuration using a new.conf file liket it is in the documentation :
    CONFIG_NCS_CLUSTER_DN="cn=svr1_oes2_cluster.o=cont ext"
    CONFIG_NCS_LDAP_INFO="ldaps://10.1.1.102:636,ldaps://10.1.1.101:636"
    CONFIG_NCS_ADMIN_DN="cn=admin.o=context"
    CONFIG_NCS_ADMIN_PASSWORD="password"
    As the root user, enter the following command at a command prompt:
    /opt/novell/ncs/install/ncs_install.py -l -f new.conf on node1 and on node2
    and then cluster exec "/opt/novell/ncs/bin/ncs-configd.py -init"
    I reboot node2 but it is exaclty the same.
    Any idea ?
    Stphane

    Originally Posted by changju
    Hi Stphane,
    This is the key of the failure,
    Aug 20 16:42:17 node2 ncs-resourced: LDAP failed: <class 'ldap.SERVER_DOWN'>
    Somehow, looks like the Python LDAP on node2 couldn't connect the LDAP servers (10.1.1.102:636 or 10.1.1.101:636).
    Please first make sure that LDAP is up and running on the two servers.
    Please check file "/etc/opt/novell/ncs/clstrlib.conf" to make sure that you have something like this,
    p4
    S'ldaps://10.1.1.102:636,ldaps://10.1.1.101:636'
    If not, you need to modify file "new.conf" and run command "/opt/novell/ncs/install/ncs_install.py -l -f new.conf" on node2 again.
    You can then check the result of the installation in file "/var/opt/novell/install/ncslog", or you can simply run command "/opt/novell/ncs/bin/ncs-configd.py -init" on node2 to try to pull down the latest NCS configuration.
    If "/opt/novell/ncs/bin/ncs-configd.py -init" churns out a bunch of "dos2unix" messages (and pulls down the scripts for the new resources at "/var/opt/novell/ncs"), you should be able to migrate the resource.
    Regards,
    Changju
    Thank you very much Changju.
    I was not aware of this log file it was very helpfull.
    Apparently a tls issue for my 2 ldap server. I change it to ldap instead of ldaps and it is working now.
    Strange because i was able to connect using ldaps with ldap browser to the 2 nodes.
    Again, thank you
    Stphane

  • File character encoding format conversion

    Hi People,
    uname -a
    Linux abcd.us.com 2.6.32-400.21.1.el5uek #1 SMP Wed Feb 20 01:35:01 PST 2013 x86_64 x86_64 x86_64 GNU/Linux
    I am trying to convert a file abcd.dat
    # file abcd.dat
    abcd.dat: binary Computer Graphics Metafile
    #file -i abcd.dat
    abcd.dat: application/octet-stream
    I've tried dos2unix in vain.
    dos2unix: converting file abcd.dat to UNIX format ...
    dos2unix: converting file abc.dat to UNIX format ...
    dos2unix: problems converting file abc.dat
    I've used iconv successfully earlier with this command
    iconv -f UTF-16 -t UTF-8  abcd.dat > abcd.abc
    only, this time I do not know the "from" format of the file,
    #iconv -l
    The following list contain all the coded character sets known.  This does
    not necessarily mean that all combinations of these names can be used for
    the FROM and TO command line parameters.  One coded character set can be
    listed with several different names (aliases).
      437, 500, 500V1, 850, 851, 852, 855, 856, 857, 860, 861, 862, 863, 864, 865,
      866, 866NAV, 869, 874, 904, 1026, 1046, 1047, 8859_1, 8859_2, 8859_3, 8859_4,
      8859_5, 8859_6, 8859_7, 8859_8, 8859_9, 10646-1:1993, 10646-1:1993/UCS4,
      ANSI_X3.4-1968, ANSI_X3.4-1986, ANSI_X3.4, ANSI_X3.110-1983, ANSI_X3.110,
      ARABIC, ARABIC7, ARMSCII-8, ASCII, ASMO-708, ASMO_449, BALTIC, BIG-5,
      BIG-FIVE, BIG5-HKSCS, BIG5, BIG5HKSCS, BIGFIVE, BS_4730, CA, CN-BIG5, CN-GB,
      CN, CP-AR, CP-GR, CP-HU, CP037, CP038, CP273, CP274, CP275, CP278, CP280,
      CP281, CP282, CP284, CP285, CP290, CP297, CP367, CP420, CP423, CP424, CP437,
      CP500, CP737, CP775, CP803, CP813, CP819, CP850, CP851, CP852, CP855, CP856,
      CP857, CP860, CP861, CP862, CP863, CP864, CP865, CP866, CP866NAV, CP868,
      CP869, CP870, CP871, CP874, CP875, CP880, CP891, CP901, CP902, CP903, CP904,
      CP905, CP912, CP915, CP916, CP918, CP920, CP921, CP922, CP930, CP932, CP933,
      CP935, CP936, CP937, CP939, CP949, CP950, CP1004, CP1008, CP1025, CP1026,
      CP1046, CP1047, CP1070, CP1079, CP1081, CP1084, CP1089, CP1097, CP1112,
      CP1122, CP1123, CP1124, CP1125, CP1129, CP1130, CP1132, CP1133, CP1137,
      CP1140, CP1141, CP1142, CP1143, CP1144, CP1145, CP1146, CP1147, CP1148,
      CP1149, CP1153, CP1154, CP1155, CP1156, CP1157, CP1158, CP1160, CP1161,
      CP1162, CP1163, CP1164, CP1166, CP1167, CP1250, CP1251, CP1252, CP1253,
      CP1254, CP1255, CP1256, CP1257, CP1258, CP1361, CP1364, CP1371, CP1388,
      CP1390, CP1399, CP4517, CP4899, CP4909, CP4971, CP5347, CP9030, CP9066,
      CP9448, CP10007, CP12712, CP16804, CPIBM861, CSA7-1, CSA7-2, CSASCII,
      CSA_T500-1983, CSA_T500, CSA_Z243.4-1985-1, CSA_Z243.4-1985-2,
      CSA_Z243.419851, CSA_Z243.419852, CSDECMCS, CSEBCDICATDE, CSEBCDICATDEA,
      CSEBCDICCAFR, CSEBCDICDKNO, CSEBCDICDKNOA, CSEBCDICES, CSEBCDICESA,
      CSEBCDICESS, CSEBCDICFISE, CSEBCDICFISEA, CSEBCDICFR, CSEBCDICIT, CSEBCDICPT,
      CSEBCDICUK, CSEBCDICUS, CSEUCKR, CSEUCPKDFMTJAPANESE, CSGB2312, CSHPROMAN8,
      CSIBM037, CSIBM038, CSIBM273, CSIBM274, CSIBM275, CSIBM277, CSIBM278,
      CSIBM280, CSIBM281, CSIBM284, CSIBM285, CSIBM290, CSIBM297, CSIBM420,
      CSIBM423, CSIBM424, CSIBM500, CSIBM803, CSIBM851, CSIBM855, CSIBM856,
      CSIBM857, CSIBM860, CSIBM863, CSIBM864, CSIBM865, CSIBM866, CSIBM868,
      CSIBM869, CSIBM870, CSIBM871, CSIBM880, CSIBM891, CSIBM901, CSIBM902,
      CSIBM903, CSIBM904, CSIBM905, CSIBM918, CSIBM921, CSIBM922, CSIBM930,
      CSIBM932, CSIBM933, CSIBM935, CSIBM937, CSIBM939, CSIBM943, CSIBM1008,
      CSIBM1025, CSIBM1026, CSIBM1097, CSIBM1112, CSIBM1122, CSIBM1123, CSIBM1124,
      CSIBM1129, CSIBM1130, CSIBM1132, CSIBM1133, CSIBM1137, CSIBM1140, CSIBM1141,
      CSIBM1142, CSIBM1143, CSIBM1144, CSIBM1145, CSIBM1146, CSIBM1147, CSIBM1148,
      CSIBM1149, CSIBM1153, CSIBM1154, CSIBM1155, CSIBM1156, CSIBM1157, CSIBM1158,
      CSIBM1160, CSIBM1161, CSIBM1163, CSIBM1164, CSIBM1166, CSIBM1167, CSIBM1364,
      CSIBM1371, CSIBM1388, CSIBM1390, CSIBM1399, CSIBM4517, CSIBM4899, CSIBM4909,
      CSIBM4971, CSIBM5347, CSIBM9030, CSIBM9066, CSIBM9448, CSIBM12712,
      CSIBM16804, CSIBM11621162, CSISO4UNITEDKINGDOM, CSISO10SWEDISH,
      CSISO11SWEDISHFORNAMES, CSISO14JISC6220RO, CSISO15ITALIAN, CSISO16PORTUGESE,
      CSISO17SPANISH, CSISO18GREEK7OLD, CSISO19LATINGREEK, CSISO21GERMAN,
      CSISO25FRENCH, CSISO27LATINGREEK1, CSISO49INIS, CSISO50INIS8,
      CSISO51INISCYRILLIC, CSISO58GB1988, CSISO60DANISHNORWEGIAN,
      CSISO60NORWEGIAN1, CSISO61NORWEGIAN2, CSISO69FRENCH, CSISO84PORTUGUESE2,
      CSISO85SPANISH2, CSISO86HUNGARIAN, CSISO88GREEK7, CSISO89ASMO449, CSISO90,
      CSISO92JISC62991984B, CSISO99NAPLPS, CSISO103T618BIT, CSISO111ECMACYRILLIC,
      CSISO121CANADIAN1, CSISO122CANADIAN2, CSISO139CSN369103, CSISO141JUSIB1002,
      CSISO143IECP271, CSISO150, CSISO150GREEKCCITT, CSISO151CUBA,
      CSISO153GOST1976874, CSISO646DANISH, CSISO2022CN, CSISO2022JP, CSISO2022JP2,
      CSISO2022KR, CSISO2033, CSISO5427CYRILLIC, CSISO5427CYRILLIC1981,
      CSISO5428GREEK, CSISO10367BOX, CSISOLATIN1, CSISOLATIN2, CSISOLATIN3,
      CSISOLATIN4, CSISOLATIN5, CSISOLATIN6, CSISOLATINARABIC, CSISOLATINCYRILLIC,
      CSISOLATINGREEK, CSISOLATINHEBREW, CSKOI8R, CSKSC5636, CSMACINTOSH,
      CSNATSDANO, CSNATSSEFI, CSN_369103, CSPC8CODEPAGE437, CSPC775BALTIC,
      CSPC850MULTILINGUAL, CSPC862LATINHEBREW, CSPCP852, CSSHIFTJIS, CSUCS4,
      CSUNICODE, CSWINDOWS31J, CUBA, CWI-2, CWI, CYRILLIC, DE, DEC-MCS, DEC,
      DECMCS, DIN_66003, DK, DS2089, DS_2089, E13B, EBCDIC-AT-DE-A, EBCDIC-AT-DE,
      EBCDIC-BE, EBCDIC-BR, EBCDIC-CA-FR, EBCDIC-CP-AR1, EBCDIC-CP-AR2,
      EBCDIC-CP-BE, EBCDIC-CP-CA, EBCDIC-CP-CH, EBCDIC-CP-DK, EBCDIC-CP-ES,
      EBCDIC-CP-FI, EBCDIC-CP-FR, EBCDIC-CP-GB, EBCDIC-CP-GR, EBCDIC-CP-HE,
      EBCDIC-CP-IS, EBCDIC-CP-IT, EBCDIC-CP-NL, EBCDIC-CP-NO, EBCDIC-CP-ROECE,
      EBCDIC-CP-SE, EBCDIC-CP-TR, EBCDIC-CP-US, EBCDIC-CP-WT, EBCDIC-CP-YU,
      EBCDIC-CYRILLIC, EBCDIC-DK-NO-A, EBCDIC-DK-NO, EBCDIC-ES-A, EBCDIC-ES-S,
      EBCDIC-ES, EBCDIC-FI-SE-A, EBCDIC-FI-SE, EBCDIC-FR, EBCDIC-GREEK, EBCDIC-INT,
      EBCDIC-INT1, EBCDIC-IS-FRISS, EBCDIC-IT, EBCDIC-JP-E, EBCDIC-JP-KANA,
      EBCDIC-PT, EBCDIC-UK, EBCDIC-US, EBCDICATDE, EBCDICATDEA, EBCDICCAFR,
      EBCDICDKNO, EBCDICDKNOA, EBCDICES, EBCDICESA, EBCDICESS, EBCDICFISE,
      EBCDICFISEA, EBCDICFR, EBCDICISFRISS, EBCDICIT, EBCDICPT, EBCDICUK, EBCDICUS,
      ECMA-114, ECMA-118, ECMA-128, ECMA-CYRILLIC, ECMACYRILLIC, ELOT_928, ES, ES2,
      EUC-CN, EUC-JISX0213, EUC-JP-MS, EUC-JP, EUC-KR, EUC-TW, EUCCN, EUCJP-MS,
      EUCJP-OPEN, EUCJP-WIN, EUCJP, EUCKR, EUCTW, FI, FR, GB, GB2312, GB13000,
      GB18030, GBK, GB_1988-80, GB_198880, GEORGIAN-ACADEMY, GEORGIAN-PS,
      GOST_19768-74, GOST_19768, GOST_1976874, GREEK-CCITT, GREEK, GREEK7-OLD,
      GREEK7, GREEK7OLD, GREEK8, GREEKCCITT, HEBREW, HP-ROMAN8, HPROMAN8, HU,
      IBM-803, IBM-856, IBM-901, IBM-902, IBM-921, IBM-922, IBM-930, IBM-932,
      IBM-933, IBM-935, IBM-937, IBM-939, IBM-943, IBM-1008, IBM-1025, IBM-1046,
      IBM-1047, IBM-1097, IBM-1112, IBM-1122, IBM-1123, IBM-1124, IBM-1129,
      IBM-1130, IBM-1132, IBM-1133, IBM-1137, IBM-1140, IBM-1141, IBM-1142,
      IBM-1143, IBM-1144, IBM-1145, IBM-1146, IBM-1147, IBM-1148, IBM-1149,
      IBM-1153, IBM-1154, IBM-1155, IBM-1156, IBM-1157, IBM-1158, IBM-1160,
      IBM-1161, IBM-1162, IBM-1163, IBM-1164, IBM-1166, IBM-1167, IBM-1364,
      IBM-1371, IBM-1388, IBM-1390, IBM-1399, IBM-4517, IBM-4899, IBM-4909,
      IBM-4971, IBM-5347, IBM-9030, IBM-9066, IBM-9448, IBM-12712, IBM-16804,
      IBM037, IBM038, IBM256, IBM273, IBM274, IBM275, IBM277, IBM278, IBM280,
      IBM281, IBM284, IBM285, IBM290, IBM297, IBM367, IBM420, IBM423, IBM424,
      IBM437, IBM500, IBM775, IBM803, IBM813, IBM819, IBM848, IBM850, IBM851,
      IBM852, IBM855, IBM856, IBM857, IBM860, IBM861, IBM862, IBM863, IBM864,
      IBM865, IBM866, IBM866NAV, IBM868, IBM869, IBM870, IBM871, IBM874, IBM875,
      IBM880, IBM891, IBM901, IBM902, IBM903, IBM904, IBM905, IBM912, IBM915,
      IBM916, IBM918, IBM920, IBM921, IBM922, IBM930, IBM932, IBM933, IBM935,
      IBM937, IBM939, IBM943, IBM1004, IBM1008, IBM1025, IBM1026, IBM1046, IBM1047,
      IBM1089, IBM1097, IBM1112, IBM1122, IBM1123, IBM1124, IBM1129, IBM1130,
      IBM1132, IBM1133, IBM1137, IBM1140, IBM1141, IBM1142, IBM1143, IBM1144,
      IBM1145, IBM1146, IBM1147, IBM1148, IBM1149, IBM1153, IBM1154, IBM1155,
      IBM1156, IBM1157, IBM1158, IBM1160, IBM1161, IBM1162, IBM1163, IBM1164,
      IBM1166, IBM1167, IBM1364, IBM1371, IBM1388, IBM1390, IBM1399, IBM4517,
      IBM4899, IBM4909, IBM4971, IBM5347, IBM9030, IBM9066, IBM9448, IBM12712,
      IBM16804, IEC_P27-1, IEC_P271, INIS-8, INIS-CYRILLIC, INIS, INIS8,
      INISCYRILLIC, ISIRI-3342, ISIRI3342, ISO-2022-CN-EXT, ISO-2022-CN,
      ISO-2022-JP-2, ISO-2022-JP-3, ISO-2022-JP, ISO-2022-KR, ISO-8859-1,
      ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, ISO-8859-6, ISO-8859-7,
      ISO-8859-8, ISO-8859-9, ISO-8859-10, ISO-8859-11, ISO-8859-13, ISO-8859-14,
      ISO-8859-15, ISO-8859-16, ISO-10646, ISO-10646/UCS2, ISO-10646/UCS4,
      ISO-10646/UTF-8, ISO-10646/UTF8, ISO-CELTIC, ISO-IR-4, ISO-IR-6, ISO-IR-8-1,
      ISO-IR-9-1, ISO-IR-10, ISO-IR-11, ISO-IR-14, ISO-IR-15, ISO-IR-16, ISO-IR-17,
      ISO-IR-18, ISO-IR-19, ISO-IR-21, ISO-IR-25, ISO-IR-27, ISO-IR-37, ISO-IR-49,
      ISO-IR-50, ISO-IR-51, ISO-IR-54, ISO-IR-55, ISO-IR-57, ISO-IR-60, ISO-IR-61,
      ISO-IR-69, ISO-IR-84, ISO-IR-85, ISO-IR-86, ISO-IR-88, ISO-IR-89, ISO-IR-90,
      ISO-IR-92, ISO-IR-98, ISO-IR-99, ISO-IR-100, ISO-IR-101, ISO-IR-103,
      ISO-IR-109, ISO-IR-110, ISO-IR-111, ISO-IR-121, ISO-IR-122, ISO-IR-126,
      ISO-IR-127, ISO-IR-138, ISO-IR-139, ISO-IR-141, ISO-IR-143, ISO-IR-144,
      ISO-IR-148, ISO-IR-150, ISO-IR-151, ISO-IR-153, ISO-IR-155, ISO-IR-156,
      ISO-IR-157, ISO-IR-166, ISO-IR-179, ISO-IR-193, ISO-IR-197, ISO-IR-199,
      ISO-IR-203, ISO-IR-209, ISO-IR-226, ISO/TR_11548-1, ISO646-CA, ISO646-CA2,
      ISO646-CN, ISO646-CU, ISO646-DE, ISO646-DK, ISO646-ES, ISO646-ES2, ISO646-FI,
      ISO646-FR, ISO646-FR1, ISO646-GB, ISO646-HU, ISO646-IT, ISO646-JP-OCR-B,
      ISO646-JP, ISO646-KR, ISO646-NO, ISO646-NO2, ISO646-PT, ISO646-PT2,
      ISO646-SE, ISO646-SE2, ISO646-US, ISO646-YU, ISO2022CN, ISO2022CNEXT,
      ISO2022JP, ISO2022JP2, ISO2022KR, ISO6937, ISO8859-1, ISO8859-2, ISO8859-3,
      ISO8859-4, ISO8859-5, ISO8859-6, ISO8859-7, ISO8859-8, ISO8859-9, ISO8859-10,
      ISO8859-11, ISO8859-13, ISO8859-14, ISO8859-15, ISO8859-16, ISO11548-1,
      ISO88591, ISO88592, ISO88593, ISO88594, ISO88595, ISO88596, ISO88597,
      ISO88598, ISO88599, ISO885910, ISO885911, ISO885913, ISO885914, ISO885915,
      ISO885916, ISO_646.IRV:1991, ISO_2033-1983, ISO_2033, ISO_5427-EXT, ISO_5427,
      ISO_5427:1981, ISO_5427EXT, ISO_5428, ISO_5428:1980, ISO_6937-2,
      ISO_6937-2:1983, ISO_6937, ISO_6937:1992, ISO_8859-1, ISO_8859-1:1987,
      ISO_8859-2, ISO_8859-2:1987, ISO_8859-3, ISO_8859-3:1988, ISO_8859-4,
      ISO_8859-4:1988, ISO_8859-5, ISO_8859-5:1988, ISO_8859-6, ISO_8859-6:1987,
      ISO_8859-7, ISO_8859-7:1987, ISO_8859-7:2003, ISO_8859-8, ISO_8859-8:1988,
      ISO_8859-9, ISO_8859-9:1989, ISO_8859-10, ISO_8859-10:1992, ISO_8859-14,
      ISO_8859-14:1998, ISO_8859-15, ISO_8859-15:1998, ISO_8859-16,
      ISO_8859-16:2001, ISO_9036, ISO_10367-BOX, ISO_10367BOX, ISO_11548-1,
      ISO_69372, IT, JIS_C6220-1969-RO, JIS_C6229-1984-B, JIS_C62201969RO,
      JIS_C62291984B, JOHAB, JP-OCR-B, JP, JS, JUS_I.B1.002, KOI-7, KOI-8, KOI8-R,
      KOI8-T, KOI8-U, KOI8, KOI8R, KOI8U, KSC5636, L1, L2, L3, L4, L5, L6, L7, L8,
      L10, LATIN-9, LATIN-GREEK-1, LATIN-GREEK, LATIN1, LATIN2, LATIN3, LATIN4,
      LATIN5, LATIN6, LATIN7, LATIN8, LATIN10, LATINGREEK, LATINGREEK1,
      MAC-CYRILLIC, MAC-IS, MAC-SAMI, MAC-UK, MAC, MACCYRILLIC, MACINTOSH, MACIS,
      MACUK, MACUKRAINIAN, MIK, MS-ANSI, MS-ARAB, MS-CYRL, MS-EE, MS-GREEK,
      MS-HEBR, MS-MAC-CYRILLIC, MS-TURK, MS932, MS936, MSCP949, MSCP1361,
      MSMACCYRILLIC, MSZ_7795.3, MS_KANJI, NAPLPS, NATS-DANO, NATS-SEFI, NATSDANO,
      NATSSEFI, NC_NC0010, NC_NC00-10, NC_NC00-10:81, NF_Z_62-010,
      NF_Z_62-010_(1973), NF_Z_62-010_1973, NF_Z_62010, NF_Z_62010_1973, NO, NO2,
      NS_4551-1, NS_4551-2, NS_45511, NS_45512, OS2LATIN1, OSF00010001,
      OSF00010002, OSF00010003, OSF00010004, OSF00010005, OSF00010006, OSF00010007,
      OSF00010008, OSF00010009, OSF0001000A, OSF00010020, OSF00010100, OSF00010101,
      OSF00010102, OSF00010104, OSF00010105, OSF00010106, OSF00030010, OSF0004000A,
      OSF0005000A, OSF05010001, OSF100201A4, OSF100201A8, OSF100201B5, OSF100201F4,
      OSF100203B5, OSF1002011C, OSF1002011D, OSF1002035D, OSF1002035E, OSF1002035F,
      OSF1002036B, OSF1002037B, OSF10010001, OSF10020025, OSF10020111, OSF10020115,
      OSF10020116, OSF10020118, OSF10020122, OSF10020129, OSF10020352, OSF10020354,
      OSF10020357, OSF10020359, OSF10020360, OSF10020364, OSF10020365, OSF10020366,
      OSF10020367, OSF10020370, OSF10020387, OSF10020388, OSF10020396, OSF10020402,
      OSF10020417, PT, PT2, PT154, R8, RK1048, ROMAN8, RUSCII, SE, SE2,
      SEN_850200_B, SEN_850200_C, SHIFT-JIS, SHIFT_JIS, SHIFT_JISX0213, SJIS-OPEN,
      SJIS-WIN, SJIS, SS636127, STRK1048-2002, ST_SEV_358-88, T.61-8BIT, T.61,
      T.618BIT, TCVN-5712, TCVN, TCVN5712-1, TCVN5712-1:1993, TIS-620, TIS620-0,
      TIS620.2529-1, TIS620.2533-0, TIS620, TS-5881, TSCII, UCS-2, UCS-2BE,
      UCS-2LE, UCS-4, UCS-4BE, UCS-4LE, UCS2, UCS4, UHC, UJIS, UK, UNICODE,
      UNICODEBIG, UNICODELITTLE, US-ASCII, US, UTF-7, UTF-8, UTF-16, UTF-16BE,
      UTF-16LE, UTF-32, UTF-32BE, UTF-32LE, UTF7, UTF8, UTF16, UTF16BE, UTF16LE,
      UTF32, UTF32BE, UTF32LE, VISCII, WCHAR_T, WIN-SAMI-2, WINBALTRIM,
      WINDOWS-31J, WINDOWS-874, WINDOWS-936, WINDOWS-1250, WINDOWS-1251,
      WINDOWS-1252, WINDOWS-1253, WINDOWS-1254, WINDOWS-1255, WINDOWS-1256,
      WINDOWS-1257, WINDOWS-1258, WINSAMI2, WS2, YU
    ==================================================
    also,
    #which od
    /usr/bin/od
    but I don't know how to use it.
    ==================================
    #cat -v abcd.dat
    has a lot of ^@
    ===================================
    #echo $LANG
    en_US.UTF-8
    ======================================================================================
    #hexdump -C abcd.dat|head -5
    00000000  00 22 00 34 00 36 00 32  00 39 00 33 00 22 00 7c  |.".4.6.2.9.3.".||
    00000010  00 22 00 32 00 30 00 31  00 33 00 2d 00 31 00 31  |.".2.0.1.3.-.1.1|
    00000020  00 2d 00 31 00 38 00 20  00 30 00 38 00 3a 00 30  |.-.1.8. .0.8.:.0|
    00000030  00 39 00 3a 00 34 00 38  00 22 00 7c 00 22 00 33  |.9.:.4.8.".|.".3|
    00000040  00 36 00 37 00 22 00 7c  00 22 00 53 00 75 00 73  |.6.7.".|.".S.u.s|
    =======================================================================================
    #vi abcd.tst
    testing
    esc:wq
    #file abcd.tst
    abcd.tst: ASCII text
    Let me know the complete iconv command with from-and-to encoding.
    Appreciate any help.

    Hi BalusC,
    as we write in jsp page as <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    is their something we can write in .properties file
    russian words are not correctly displayed in browser......how we can dispaly it in correct format...??
    i have all russian words in my .properties file
    Thanks a lot

  • Reading a CSV file from server

    Hi All,
    I am reading a CSV file from server and my internal table has only one field with lenght 200. In the input CSV file there are more than one column and while splitting the file my internal table should have same number of rows as columns of the input record.
    But when i do that the last field in the internal table is appened with #.
    Can somebody tell me the solution for this.
    U can see the my code below.
    data: begin of itab_infile occurs 0,
             input(3000),
          end of itab_infile.
    data: begin of itab_rec occurs 0,
             record(200),
          end of itab_rec.
    data: c_comma(1) value ',',
            open dataset f_name1 for input in text mode encoding default.
            if sy-subrc <> 0.
              write: /, 'FILE NOT FOUND'.
              exit.
            endif.
    do
      read dataset p_ipath into waf_infile.
      split itab_infile-input at c_sep into table itab_rec.
    enddo.
    Thanks in advance.
    Sunil

    Sunil,
    You go not mention the platform on which the CSV file was created and the platform on which it is read.
    A common problem with CSV files created on MS/Windows platforms and read on unix is the end-of-record (EOR) characters.
    MS/Windows usings <CR><LF> as the EOR
    Unix using either <CR> or <LF>
    If on unix open the file using vi in a telnet session to confirm the EOR type.
    The fix options.
    1) Before opening the opening the file in your ABAP program run the unix command dos2unix.
    2) Transfer the file from the MS/Windows platform to unix using FTP using ascii not bin.  This does the dos2unix conversion on the fly.
    3) Install SAMBA and share the load directory to the windows platforms.  SAMBA also handles the dos2unix and unix2dos conversions on the fly.
    Hope this helps
    David Cooper

  • Oracle 8.0.5.1 EE DBMS_JOB Problem

    I am running Oracle 8.0.5.1 EE on Redhat Linux version 6.1 with the glibcpatch applied.
    I have come across a problem with regular execution of submitted jobs.
    I submit a job(any job) and when execution time comes, it fails. I have dbms_job setup correctly for the database. The init.ora parameters are set correctly and the snp process is running.
    I know the job is valid because I can force a job to run using the dbms_job.run procedure.
    This tells me everything is running fine. However, when the execute time is reached, the user_jobs table shows a failure.
    I have tried the same exact procedure and job on Oracle 8.0.5 EE on Solaris and it works fine.
    I am at a loss of what to do next to resolve this issue.
    Any help would be greatly appreciated.
    Thanks
    Christopher Fitch
    null

    Hi,
    I also had a problem with these scripts.
    Try : dos2unix oratab.sh and/or dos2unix orainst.sh
    (and chmod u+x oratab.sh)
    bye
    Laurent
    Andy Hanas (guest) wrote:
    : I must be doing something wrong that's really basic. I'm
    : attempting to install Oracle 8.0.5.1 on OpenLinux 2.2. I've
    : done everything the documentation has said, but I cannot get
    the
    : oratab.sh script to run (so, I've really gotting no where).
    : When I attempt to run the script I get the follwing:
    : bash$ sh oratab.sh
    : : command not found
    : : command not found
    : : command not found
    : : command not found
    : : command not found
    : : command not found
    : : command not found
    : : command not found
    : 'ratab.sh: syntax error near unexpected token `in
    : 'ratab.sh: oratab.sh: line 30: `case ${N}$C
    : in
    : Any ideas on what I'm doing wrong or how I can debug this
    thing?
    : Thanks for any help!
    null

  • Oracle 8.0.5.1 Install on OpenLinux Problem

    I must be doing something wrong that's really basic. I'm
    attempting to install Oracle 8.0.5.1 on OpenLinux 2.2. I've
    done everything the documentation has said, but I cannot get the
    oratab.sh script to run (so, I've really gotting no where).
    When I attempt to run the script I get the follwing:
    bash$ sh oratab.sh
    : command not found
    : command not found
    : command not found
    : command not found
    : command not found
    : command not found
    : command not found
    : command not found
    'ratab.sh: syntax error near unexpected token `in
    'ratab.sh: oratab.sh: line 30: `case ${N}$C
    in
    Any ideas on what I'm doing wrong or how I can debug this thing?
    Thanks for any help!
    null

    Hi,
    I also had a problem with these scripts.
    Try : dos2unix oratab.sh and/or dos2unix orainst.sh
    (and chmod u+x oratab.sh)
    bye
    Laurent
    Andy Hanas (guest) wrote:
    : I must be doing something wrong that's really basic. I'm
    : attempting to install Oracle 8.0.5.1 on OpenLinux 2.2. I've
    : done everything the documentation has said, but I cannot get
    the
    : oratab.sh script to run (so, I've really gotting no where).
    : When I attempt to run the script I get the follwing:
    : bash$ sh oratab.sh
    : : command not found
    : : command not found
    : : command not found
    : : command not found
    : : command not found
    : : command not found
    : : command not found
    : : command not found
    : 'ratab.sh: syntax error near unexpected token `in
    : 'ratab.sh: oratab.sh: line 30: `case ${N}$C
    : in
    : Any ideas on what I'm doing wrong or how I can debug this
    thing?
    : Thanks for any help!
    null

  • [SOLVED]Is my hosts file functioning as it should?

    I'm using this script to update my hosts file with ad blocking settings.
    #!/bin/bash
    # Hosts file updater
    HFSERVER="http://hostsfile.mine.nu.nyud.net"
    HFILE="hosts.zip"
    ORIGFILE="/etc/hosts.original"
    clear
    echo "-------------------------------------------------------------"
    echo "This script will update your Hosts file to the latest version"
    echo "Your original Hosts file will be renamed to $ORIGFILE"
    echo "-------------------------------------------------------------"
    echo ""
    if [ ! -f "$ORIGFILE" ] ; then
    echo "Backing up your previous hosts file.."
    cp -v /etc/hosts $ORIGFILE # I like verbose file operations. Can be less verbose if necessary.
    fi
    echo "Retrieving $HFILE from $HFSERVER"
    echo ""
    wget -O /tmp/$HFILE $HFSERVER/$HFILE
    unzip -p /tmp/$HFILE | dos2unix > /tmp/hosts
    if [ 'grep -c "banner" /tmp/hosts' ];then
    echo "Downloaded and unpacked $HFILE OK"
    echo "Appending host list to original content" # which was probably there for a reason, like to make sure localhost worked, and possibly even more stuff if part of a corporate LAN
    #cp -f -u /tmp/hosts /etc/hosts
    cat $ORIGFILE >/etc/hosts
    echo "" >>/etc/hosts # to make sure the original file ends in a new-line so that 2 entries don't end up on the same line, either causing unexpected behavior or not working at all
    cat /tmp/hosts >>/etc/hosts
    rm -fv /tmp/hosts* # again, I like verbose file operations. I like to know what my system is doing.
    echo "Update process complete"
    #echo "-------------------------------------------------------------"
    echo "As a side-effect of this script, any changes you wish to make"
    echo "persistent in the hosts file should be made to $ORIGFILE"
    echo "because /etc/hosts will be respawned from that file and the "
    echo "newlist from the server each time this script runs."
    exit
    else
    echo "Update failed"
    fi
    http://hostsfile.mine.nu/downloads/updatehosts.sh.txt
    And my hosts file now looks like this:
    # /etc/hosts: static lookup table for host names
    #<ip-address> <hostname.domain.org> <hostname>
    127.0.0.1 localhost.localdomain localhost pote
    # The Hosts File Project http://hostsfile.mine.nu
    # Global Advert Servers Blocklist - Personal Edition
    # Release 13/09/2008
    # Servers Verified as up and running 13/09/2008 (by dns exploration)
    # Updated sorted and maintained by Andrew Short (sh0rtie)
    # Contact: [email protected]
    # A big thank you to all contributers (too many to mention)
    # who really have made this project a success, well done :)
    # Licensed under the LGPL a copy of the license may be viewed at
    # http://www.gnu.org/licenses/lgpl.txt
    # WARNING:
    # This file is *extremely comprehensive* and some sites might be
    # included here that you wish to visit, if this is the case you can
    # deactivate the block on that site by placing a # (octothorpe)symbol
    # before its entry, this will deactivate blocking on that server
    # so for example #127.0.0.1 foobar.com
    # will enable you to visit foobar.com or you can just simply delete
    # the line that contains the site you wish to visit.
    # NB:
    # For some computer software updates you may need to disable
    # this file in order to perform the update, if you have problems
    # rename this file from "hosts" to "hosts.txt" reboot then perform
    # the update and then rename this file back to "hosts" to re-enable it
    # You must keep the below lines
    127.0.0.1 localhost
    127.0.0.1 pop3.norton.antivirus
    127.0.0.1 pop3.spa.norton.antivirus
    # /etc/hosts: static lookup table for host names
    #<ip-address> <hostname.domain.org> <hostname>
    127.0.0.1 localhost.localdomain localhost pote
    # End of file
    # The Hosts File Project http://hostsfile.mine.nu
    # Global Advert Servers Blocklist - Personal Edition
    # Release 13/09/2008
    # Servers Verified as up and running 13/09/2008 (by dns exploration)
    # Updated sorted and maintained by Andrew Short (sh0rtie)
    # Contact: [email protected]
    # A big thank you to all contributers (too many to mention)
    # who really have made this project a success, well done :)
    # Licensed under the LGPL a copy of the license may be viewed at
    # http://www.gnu.org/licenses/lgpl.txt
    # WARNING:
    # This file is *extremely comprehensive* and some sites might be
    # included here that you wish to visit, if this is the case you can
    # deactivate the block on that site by placing a # (octothorpe)symbol
    # before its entry, this will deactivate blocking on that server
    # so for example #127.0.0.1 foobar.com
    # will enable you to visit foobar.com or you can just simply delete
    # the line that contains the site you wish to visit.
    # NB:
    # For some computer software updates you may need to disable
    # this file in order to perform the update, if you have problems
    # rename this file from "hosts" to "hosts.txt" reboot then perform
    # the update and then rename this file back to "hosts" to re-enable it
    # You must keep the below lines
    127.0.0.1 localhost
    127.0.0.1 pop3.norton.antivirus
    127.0.0.1 pop3.spa.norton.antivirus
    127.0.0.1 admintds.megatds.com
    127.0.0.1 ads.game.net
    127.0.0.1 ads.tokgajah.com
    127.0.0.1 dl.downloadhosting.com
    127.0.0.1 game.treeloot.com
    127.0.0.1 gw1.celticfestival.org
    127.0.0.1 incestlove.info
    127.0.0.1 klickcash.com
    127.0.0.1 loomia.cachefly.net
    127.0.0.1 pornoexit.com
    127.0.0.1 privacy.virtumundo.com
    127.0.0.1 redirect.virtumundo.com
    127.0.0.1 tds.megatds.com
    127.0.0.1 telebizz.org.uk
    127.0.0.1 the2all.info
    127.0.0.1 treeloot.com
    127.0.0.1 ultraload.net
    127.0.0.1 ultratds.com
    127.0.0.1 v1.cc
    127.0.0.1 virtumundo.com
    # etc...
    The thing i'm unsure of is this section:
    # You must keep the below lines
    127.0.0.1 localhost
    Since localhost is already stated here:
    #<ip-address> <hostname.domain.org> <hostname>
    127.0.0.1 localhost.localdomain localhost pote
    For now I've deleted the redundant localhost entry, since it seems to be there for windows compatability.
    Is there any harm in leaving that entry?
    Last edited by verve (2008-11-29 04:08:29)

    Not as far as I know.
    It probably just re-encounters the localhost hostname and either dumbly re-adds it to the internal table or ignores it. In any case, no logically discernible harm done.
    -dav7

  • Adding carraige Return at the end of the file

    The following is my Shell script which will transfer the File from one path to another:
    The file is having /n(Line Feed) at the end of earch line,but the client required a Carraige Return /r along with Line Feed for all the lines in the Output File.
    Please guide me how to add Carraige Return before Line Feed
    The following is the Shell Script:
    #!/bin/bash
    login_usr_pwd=$1
    conc_user_id=$2
    conc_user_name=$3
    requestid=$4
    prev_req_id=$5
    report_type=$6
    batch_name=$7
    file_name="o$prev_req_id.out"
    echo $report_type
    echo $batch_name
    echo $file_name
    if [ "$report_type" = "EFT" ]
    then
    file_1="$batch_name.aba"
    echo "EFT-----------"
    echo $file_1
    echo "-----------"
    tr -d '<#***#>' < $COMMON_TOP/admin/$APPLOUT/$file_name > $XXAP_TOP/out/"$file_1"
    chmod 777 $XXAP_TOP/out/"$file_1"
    else
    file_1="out_1_$prev_req_id.txt"
    echo $file_name
    echo $file_1
    tr -d '<#***#>' < $COMMON_TOP/admin/$APPLOUT/$file_name > $XXAP_TOP/out/$file_1
    chmod 777 $XXAP_TOP/out/$file_1
    fi
    Best Regards,
    Mahi

    add chr(10)+chr(13) (dos/windws line ending): unix2dos <file>remove chr(10)+chr(13), make end of line only chr(10): dos2unix <file>

  • [solved]numbers from a text file as variables that I can do calcs on

    Hi, I'm a bit stuck on this.  If I try to assign a variable as the result of a command output that parses a text file, and then try and use that variable later on eg.  bc it doesn't work.  The latest error gives me
    (standard_in) 1: illegal character: ^M
    So for example if I try to use awk to extract line 26, which looks like this:
    50
    and assign it to a variable "POINTS":
    POINTS=$(cat blahblah.txt | awk "NR==26")
    echo $POINTS
    produces the output "50" as expected,
    but when I try and multiply the output by 2:
    NEWVALUE=$(echo "$POINTS * 2" | bc)
    echo $NEWVALUE
    Gives the illegal character error above.  Strangely, if I put
    POINTS=50
    above the bc calculation line, it all works properly.
    EDIT- FORGET IT
    I think it's DOS format text crappy crap problem.  Nevermind.
    Oh, and I'll mark this solved after I've had my cup of tea.  And after I've checked it really is solved of course...
    Last edited by darkbeanies (2012-08-26 15:08:09)

    yup, dos2unix fixed all problems.  Hoorah!

  • CLOB / Charset / Java / Unix Issue

    Hi,
    I'm encountering the following problem.
    I'm working on a 3-tiers architecture with an Oracle Database (8.1.7)
    a Weblogic application server 6.1 SP4 and a Web server under Aix 4.3
    (all 3 are under AIX 4.3 on the same platform).
    My application has a web interface that allows users to upload files
    to the server from their PC clients and a webbrowser, that insert each
    file into a oracle Clob (via Java Code) and that call a stored
    procedure (with java code again) to extract this clob to a file
    (UTL_file package), then, the extracted file is processed line by line
    and information inserted in others tables.
    The issue is that some characters (acute, grave accent ....etc)
    appears as question marks in the database or that some date from the
    file can't be processed because they are structured as DD/MM/YYYY
    (french notation, but that normal I'm from france).
    I first thougt of an NLS_LANG problem but on the weblogic server it is
    set to french_france.WE88859P15 that seems to be right and the same
    the database configuration.
    I then tried to performs some conversion when the clob data were
    extracted to file (from WE88859P15 TO CP152 or vice-versa) with the
    oracle convert function but it seems that it doesn't work.
    An other but coherent symptoms is that the extracted files (from the
    clob columns) seems not to be fine (accent are not recognized).
    This is the java code used to load file to clob (on the weblogic
    server side)
    con = dbHandle.getAdminConnection();
    con.setAutoCommit(false);
    /// NEW IMPORT
    // int taskId = DBTools.getOraSeqValue("vtr.VTR_SEQ_LOG_IMPORT",
    DBTools.NEXTVAL,con);
    int taskId = DBTools.getOraSeqValue(SqlQueryDefinition.seqLogImport.toString(),
    DBTools.NEXTVAL,con);
    Debug.out.println("taskId " + taskId);
    // String cmd = "insert into vtr.vtr_log_import
    (cod_task,DTE_DEBUT,lob_imp,lob_rej,lob_log, txt_nom_fic_orig,
    txt_utilisateur) " +
    // "values ("+ taskId
    +",sysdate,empty_clob(),empty_clob(),empty_clob(), '"+file+"','"+
    ((UserBean)request.getSession().getAttribute("userbean")).getIdentifier()+"')";
    // stmt = con.createStatement();
    // stmt.executeQuery(cmd);
    // stmt.close();
    pstmt = con.prepareStatement(SqlQueryDefinition.initLigneImport.toString());
    pstmt.setInt(1,taskId);
    pstmt.setString(2,file);
    pstmt.setString(3,((UserBean)request.getSession().getAttribute("userbean")).getIdentifier());
    pstmt.executeQuery();
    pstmt.close();
    con.commit();
    // Writing CLOB
    // cmd = "SELECT cod_task,lob_imp,lob_rej,lob_log FROM
    vtr.vtr_log_import WHERE cod_task="+ taskId +" for update";
    // stmt = con.createStatement();
    // rset = stmt.executeQuery(cmd);
    pstmt = con.prepareStatement(SqlQueryDefinition.setBlobImport.toString());
    pstmt.setInt(1,taskId);
    rset = pstmt.executeQuery();
    rset.next();
    File csvFile = new File(localFile);
    System.out.println("csvFile length = " + csvFile.length());
    File unixFile = new File(localFile+".ux");
    Tools.dos2Unix(csvFile, unixFile);
    FileInputStream instream = new FileInputStream(unixFile);
    // support Weblogic
    clob = ClobComponent.factory(DBUtil.getInstance().isWebLogicPlatform());
    clob.setClob(rset,2);
    outstream = clob.getAsciiOutputStream();
    size = clob.getBufferSize();
    byte[] buffer = new byte[size];
    int length = -1;
    while ((length = instream.read(buffer)) != -1)
    outstream.write(buffer, 0, length);
    instream.close();
    outstream.close();
    rset.close();
    // stmt.close();
    pstmt.close();
    rset=null;
    // stmt = null;
    pstmt=null;
    con.commit();
    // IMPORT
    cs = con.prepareCall(SqlQueryDefinition.importStoredProc.toString());
    index = 1;
    cs.setString(index++, fullPath); // 1
    cs.setString(index++,
    ((UserBean)request.getSession().getAttribute("userbean")).getIdentifier());
    // 2
    cs.registerOutParameter(index++,java.sql.Types.VARCHAR); // 3
    cs.registerOutParameter(index++,java.sql.Types.VARCHAR); // 4
    cs.registerOutParameter(index++,java.sql.Types.NUMERIC); // 5
    cs.setInt(index++, taskId); // 6
    cs.executeQuery();
    String fichier1 = cs.getString(3);
    String fichier2 = cs.getString(4);
    int returnCode = cs.getInt(5);
    System.out.println("returnCode/fichier1/2 : " + returnCode + " & "
    + fichier1 + " & " + fichier2);
    cs.close();
    con.commit();
    This is the PL/SQL code used to unload clob to dile (on the oracle
    side)
    PROCEDURE writeToFile (id NUMBER, a_fichier VARCHAR2)
    IS
    result CLOB;
    cvl_tmp VARCHAR2 (32000);
    nvl_amount NUMBER := 250;
    nvl_pos NUMBER := 1;
    nvl_clob_length NUMBER;
    instr_pos NUMBER;
    file_handle UTL_FILE.file_type;
    BEGIN
    file_handle := UTL_FILE.FOPEN(
    substr(a_fichier, 1, instr(a_fichier, file_separator, -1,
    1)-1), -- dir
    substr(a_fichier, instr(a_fichier, file_separator, -1, 1)+1),
    -- file
    'W');
    select lob_imp
    INTO result
    from vtr_log_import
    where cod_task = id;
    --write clob to file
    nvl_clob_length := DBMS_LOB.getlength (result);
    cvl_tmp := NULL;
    nvl_amount := 250;
    nvl_pos := 1;
    LOOP
    instr_pos :=
    DBMS_LOB.INSTR (result, CHR (10), nvl_pos, 1) -
    nvl_pos;
    --DBMS_OUTPUT.PUT_LINE(nvl_pos||': Of length : '||instr_pos);
    IF nvl_pos + instr_pos > nvl_clob_length
    THEN
    instr_pos := nvl_clob_length - nvl_pos;
    DBMS_LOB.READ (
    lob_loc=> result,
    amount=> instr_pos,
    offset=> nvl_pos,
    buffer=> cvl_tmp
    EXIT;
    END IF;
    DBMS_LOB.READ (
    lob_loc=> result,
    amount=> instr_pos,
    offset=> nvl_pos,
    buffer=> cvl_tmp
    -- DBMS_OUTPUT.PUT_LINE(cvL_tmp);
    cvl_tmp := CONVERT(cvl_tmp, 'WE8MSWIN1252', 'WE8ISO8859P15');
    UTL_FILE.put_line (file_handle, cvl_tmp);
    nvl_pos := nvl_pos
    + instr_pos
    + 1;
    IF nvl_pos > nvl_clob_length
    THEN
    EXIT;
    END IF;
    END LOOP;
    UTL_FILE.fclose (file_handle);
    END writeToFile;
    I'm using the oracle thin driver but it's not set in classpath maybe a
    problem with that ?
    <JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
    InitialCapacity="1" MaxCapacity="100" Name="oracleUserPool"
    Password="XXXXXXX
    Properties="user=vtr_usr;dll=ocijdbc8;protocol=thin"
    Targets="myserver" TestConnectionsOnRelease="true"
    TestConnectionsOnReserve="true" TestTableName="dual"
    URL="jdbc:oracle:thin:@localhost:1521:ssr"/>
    Maybe a problem with the properties of weblogic.codeset (I don"t set
    it) ?
    Many thanks in advance, I have no idea even if I suspect the java
    store to file or the UTL_file extration to file steps to be in cause !
    Run-O

    Run-O wrote:
    Hi,
    I'm encountering the following problem.Hi. The first thing I'd do to narrow the search is to see if my Java code
    worked in a standalone program, without weblogic in the picture. Once
    you get Oracle's JDBC driver to work with Oracle's DBMS, it shouldn't
    be hard to get the same stuff to work inside weblogic, or find out why it
    doesn't.
    Joe
    >
    >
    I'm working on a 3-tiers architecture with an Oracle Database (8.1.7)
    a Weblogic application server 6.1 SP4 and a Web server under Aix 4.3
    (all 3 are under AIX 4.3 on the same platform).
    My application has a web interface that allows users to upload files
    to the server from their PC clients and a webbrowser, that insert each
    file into a oracle Clob (via Java Code) and that call a stored
    procedure (with java code again) to extract this clob to a file
    (UTL_file package), then, the extracted file is processed line by line
    and information inserted in others tables.
    The issue is that some characters (acute, grave accent ....etc)
    appears as question marks in the database or that some date from the
    file can't be processed because they are structured as DD/MM/YYYY
    (french notation, but that normal I'm from france).
    I first thougt of an NLS_LANG problem but on the weblogic server it is
    set to french_france.WE88859P15 that seems to be right and the same
    the database configuration.
    I then tried to performs some conversion when the clob data were
    extracted to file (from WE88859P15 TO CP152 or vice-versa) with the
    oracle convert function but it seems that it doesn't work.
    An other but coherent symptoms is that the extracted files (from the
    clob columns) seems not to be fine (accent are not recognized).
    This is the java code used to load file to clob (on the weblogic
    server side)
    con = dbHandle.getAdminConnection();
    con.setAutoCommit(false);
    /// NEW IMPORT
    // int taskId = DBTools.getOraSeqValue("vtr.VTR_SEQ_LOG_IMPORT",
    DBTools.NEXTVAL,con);
    int taskId = DBTools.getOraSeqValue(SqlQueryDefinition.seqLogImport.toString(),
    DBTools.NEXTVAL,con);
    Debug.out.println("taskId " + taskId);
    // String cmd = "insert into vtr.vtr_log_import
    (cod_task,DTE_DEBUT,lob_imp,lob_rej,lob_log, txt_nom_fic_orig,
    txt_utilisateur) " +
    // "values ("+ taskId
    +",sysdate,empty_clob(),empty_clob(),empty_clob(), '"+file+"','"+
    ((UserBean)request.getSession().getAttribute("userbean")).getIdentifier()+"')";
    // stmt = con.createStatement();
    // stmt.executeQuery(cmd);
    // stmt.close();
    pstmt = con.prepareStatement(SqlQueryDefinition.initLigneImport.toString());
    pstmt.setInt(1,taskId);
    pstmt.setString(2,file);
    pstmt.setString(3,((UserBean)request.getSession().getAttribute("userbean")).getIdentifier());
    pstmt.executeQuery();
    pstmt.close();
    con.commit();
    // Writing CLOB
    // cmd = "SELECT cod_task,lob_imp,lob_rej,lob_log FROM
    vtr.vtr_log_import WHERE cod_task="+ taskId +" for update";
    // stmt = con.createStatement();
    // rset = stmt.executeQuery(cmd);
    pstmt = con.prepareStatement(SqlQueryDefinition.setBlobImport.toString());
    pstmt.setInt(1,taskId);
    rset = pstmt.executeQuery();
    rset.next();
    File csvFile = new File(localFile);
    System.out.println("csvFile length = " + csvFile.length());
    File unixFile = new File(localFile+".ux");
    Tools.dos2Unix(csvFile, unixFile);
    FileInputStream instream = new FileInputStream(unixFile);
    // support Weblogic
    clob = ClobComponent.factory(DBUtil.getInstance().isWebLogicPlatform());
    clob.setClob(rset,2);
    outstream = clob.getAsciiOutputStream();
    size = clob.getBufferSize();
    byte[] buffer = new byte[size];
    int length = -1;
    while ((length = instream.read(buffer)) != -1)
    outstream.write(buffer, 0, length);
    instream.close();
    outstream.close();
    rset.close();
    // stmt.close();
    pstmt.close();
    rset=null;
    // stmt = null;
    pstmt=null;
    con.commit();
    // IMPORT
    cs = con.prepareCall(SqlQueryDefinition.importStoredProc.toString());
    index = 1;
    cs.setString(index++, fullPath); // 1
    cs.setString(index++,
    ((UserBean)request.getSession().getAttribute("userbean")).getIdentifier());
    // 2
    cs.registerOutParameter(index++,java.sql.Types.VARCHAR); // 3
    cs.registerOutParameter(index++,java.sql.Types.VARCHAR); // 4
    cs.registerOutParameter(index++,java.sql.Types.NUMERIC); // 5
    cs.setInt(index++, taskId); // 6
    cs.executeQuery();
    String fichier1 = cs.getString(3);
    String fichier2 = cs.getString(4);
    int returnCode = cs.getInt(5);
    System.out.println("returnCode/fichier1/2 : " + returnCode + " & "
    + fichier1 + " & " + fichier2);
    cs.close();
    con.commit();
    This is the PL/SQL code used to unload clob to dile (on the oracle
    side)
    PROCEDURE writeToFile (id NUMBER, a_fichier VARCHAR2)
    IS
    result CLOB;
    cvl_tmp VARCHAR2 (32000);
    nvl_amount NUMBER := 250;
    nvl_pos NUMBER := 1;
    nvl_clob_length NUMBER;
    instr_pos NUMBER;
    file_handle UTL_FILE.file_type;
    BEGIN
    file_handle := UTL_FILE.FOPEN(
    substr(a_fichier, 1, instr(a_fichier, file_separator, -1,
    1)-1), -- dir
    substr(a_fichier, instr(a_fichier, file_separator, -1, 1)+1),
    -- file
    'W');
    select lob_imp
    INTO result
    from vtr_log_import
    where cod_task = id;
    --write clob to file
    nvl_clob_length := DBMS_LOB.getlength (result);
    cvl_tmp := NULL;
    nvl_amount := 250;
    nvl_pos := 1;
    LOOP
    instr_pos :=
    DBMS_LOB.INSTR (result, CHR (10), nvl_pos, 1) -
    nvl_pos;
    --DBMS_OUTPUT.PUT_LINE(nvl_pos||': Of length : '||instr_pos);
    IF nvl_pos + instr_pos > nvl_clob_length
    THEN
    instr_pos := nvl_clob_length - nvl_pos;
    DBMS_LOB.READ (
    lob_loc=> result,
    amount=> instr_pos,
    offset=> nvl_pos,
    buffer=> cvl_tmp
    EXIT;
    END IF;
    DBMS_LOB.READ (
    lob_loc=> result,
    amount=> instr_pos,
    offset=> nvl_pos,
    buffer=> cvl_tmp
    -- DBMS_OUTPUT.PUT_LINE(cvL_tmp);
    cvl_tmp := CONVERT(cvl_tmp, 'WE8MSWIN1252', 'WE8ISO8859P15');
    UTL_FILE.put_line (file_handle, cvl_tmp);
    nvl_pos := nvl_pos
    + instr_pos
    + 1;
    IF nvl_pos > nvl_clob_length
    THEN
    EXIT;
    END IF;
    END LOOP;
    UTL_FILE.fclose (file_handle);
    END writeToFile;
    I'm using the oracle thin driver but it's not set in classpath maybe a
    problem with that ?
    <JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
    InitialCapacity="1" MaxCapacity="100" Name="oracleUserPool"
    Password="XXXXXXX
    Properties="user=vtr_usr;dll=ocijdbc8;protocol=thin"
    Targets="myserver" TestConnectionsOnRelease="true"
    TestConnectionsOnReserve="true" TestTableName="dual"
    URL="jdbc:oracle:thin:@localhost:1521:ssr"/>
    Maybe a problem with the properties of weblogic.codeset (I don"t set
    it) ?
    Many thanks in advance, I have no idea even if I suspect the java
    store to file or the UTL_file extration to file steps to be in cause !
    Run-O

  • Host Builtin Not Working in Linux

    I'm trying to convert a file using the linux command dos2unix through forms HOST builtin. I've set the path variable in the environment file to /usr/bin, where the dos2unix command resides. I've had no luck converting this file. I've also tried:
    host('/usr/bin/dos2unix file.txt');
    with no luck. If I log on as the same user that started the forms server and issue the dos2unix command through the terminal, the file is successfully converted.
    What else do I need to do to get the host builtin to work on Linux?

    You already have said the answer - the Forms server has been started with permissions that allow access to that file..if you are not logged in as that use you don't have the permissions to execute the file....
    Regards
    Grant Ronald

Maybe you are looking for