Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > Code & Utilities

Retirement Notice

Baanboard is shutting down on 31-dec-2023. See: http://www.baanboard.com/baanboard/showthread.php?t=76043


User login

Frontpage Sponsor

Main

Poll
What do you expect from your SI Implementation partner for the success of ERP implementation.
Bring best practices - Not to offer more CR's Leveraging standard functions
20%
Need more honesty to work with the Users until their processes are fully mapped & Users are trained
40%
Focus on process automation/ integrations/ Real time data/ BI analytics
13%
Stick to basics
27%
Total votes: 15

Reference Content

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12th September 2002, 10:49
richard richard is offline
Senior Member
 
Join Date: Oct 2001
Location: France
Posts: 183
richard is on a distinguished road
Baan: triton 3.2/Baan IV/LN - DB: Oracle 9.2.0.6/informix 31 - OS: HP UX 11.23
Simple report conversion for excel

This script converts a standard report in a excel-readable csv file. Standard = header (1 up to 3 lines) and details with | field separator. Specially the querys are standard.

Sorry, the comments are french.

Code:
#! /bin/ksh
# trexcel
#
# transformation d'un fichier edition baan en fichier excel
# 
if [ $# -ge 2 ]
then
	echo "le nom de fichier ne doit pas comporter de blanc"
	echo "le fichier sera sous forme brute et non transforme excel"
	echo "taper transmit\c"
	read reponse
fi
awk -f /administration/awk-supent $1  > $HOME/temp
# suppression des blancs apres | (cadrage excel correct)
cat $HOME/temp | sed '1,$s/| /|/g' | sed '1,$s/;/\./g' | sed '1,$s/|/;/g' > $1
unix2dos $1 $1 2>/dev/null
rm $HOME/temp
chmod 666 $1

Code:
#! /bin/ksh
# awk-supent
#
# supression de toutes les lignes non significatives d'une edition
# 
#
BEGIN	{
	ligne1="";
	ligne2="";
	ligne3="";
	titre=0;
	entete=0;
	}
# stockage des entetes
{
pipes=index($0,"|");
if (pipes>0&&entete==0) {
	if (titre==0) {
		 ligne1=$0; titre++; print $0}
	else
	{if (titre==1)
		 { ligne2=$0; titre++; print $0}
	else
	{if (titre==2)
		 { ligne3=$0; titre++; print $0}
	}
	}
}
# test une entete trouvee
if (pipes==0&&titre>0)
	{entete=1}
#
# impression des lignes differentes des entetes
#
if (pipes>0&&$0!=ligne1&&$0!=ligne2&&$0!=ligne3)
	{print $0}
}


device:
Code:
|  Maintain Device Data                                                        |
|------------------------------------------------------------------------------|
|  Device           : E                                                        |
|  Description      : Excel (extraction vers)                  (div RIM)       |
|  Device Type      : Rewrite file                                             |
|  Locale           :                                                          |
|--Printer          -----------------------------------------------------------|
|  Driver           :                                                          |
|  Device Queue     :                                                          |
|  Paper Type       :                                                          |
|  Left Margin      :         Form Feed        :                               |
|--File             -----------------------------------------------------------|
|  Driver           :                                                          |
|  Shell Command    :                                                          |
|  4GL Program      : ttstpconv                                                |
|  Argument         : ASCII\/administration/trexcel %s                         |
|  Path             :                                                          |
|  Change allowed   : Yes                                                      |
|  Page Length      :   66                                                     |
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Page x of y: Kevin Brock's solution. ~Vamsi Code & Utilities 4 5th January 2006 12:08
Simple tax (VAT) report tapzhou Tools Development 1 18th June 2004 14:02
Code for a simple Maintain Session learner Tools Development 8 3rd September 2003 18:47


All times are GMT +2. The time now is 23:40.


©2001-2023 - Baanboard.com - Baanforums.com