AWK/SEDManipulate text file, Create a CSV file using a feeding file - text

I need to manipulate a text file, I created it using wmic scripts.
Original file:
Node,Manufacturer,Model
NAKAMA,Dell Computer Corporation,PowerEdge 6650
Node,Name,Version
NAKAMA,Microsoft Windows Server 2003 R2 Enterprise Edition|C:\WINDOWS|\Device\Harddisk0\Partition1,5.2.3790
Node,AddressWidth
NAKAMA,32
NAKAMA,32
NAKAMA,32
NAKAMA,32
Node,SerialNumber
NAKAMA,BZJS571
Node,Name,Version
NAKAMA,Microsoft Office Excel Viewer,12.0.6219.1000
NAKAMA,Microsoft Software Update for Web Folders (English) 14,14.0.4763.1000
NAKAMA,Microsoft Office Visio MUI (English) 2010,14.0.4763.1000
NAKAMA,Microsoft Office Shared Setup Metadata MUI (English) 2010,14.0.4763.1000
NAKAMA,Microsoft Office Visio 2010,14.0.4763.1000
NAKAMA,Microsoft Office Proofing (English) 2010,14.0.4763.1000
NAKAMA,Microsoft Office Shared MUI (English) 2010,14.0.4763.1000
NAKAMA,Microsoft Office Proof (English) 2010,14.0.4763.1000
NAKAMA,Microsoft Office Proof (Spanish) 2010,14.0.4763.1000
NAKAMA,Microsoft Office Proof (French) 2010,14.0.4763.1000
NAKAMA,MSXML 6 Service Pack 2 (KB954459),6.20.1099.0
NAKAMA,Microsoft SQL Server 2005 Express Edition (DTC),9.2.3042.00
NAKAMA,Microsoft .NET Framework 3.0 Service Pack 2,3.2.30729
NAKAMA,Microsoft Group Policy Management Console with SP1,1.0.2.0
NAKAMA,Microsoft Windows SDK for Windows 7 (7.1),7.1.30514
NAKAMA,Microsoft SQL Server Native Client,9.00.3042.00
NAKAMA,Broadcom Management Programs,10.38.04
NAKAMA,Microsoft .NET Framework 3.5 SP1,3.5.30729
NAKAMA,Symantec Endpoint Protection,11.0.7101.1056
NAKAMA,Windows Resource Kit Tools - ClusterRecovery.exe,1.0.0.1
NAKAMA,Java(TM) 6 Update 11,6.0.110
NAKAMA,Windows Resource Kit Tools,5.2.3790
NAKAMA,ILMT-TAD4D Agent,7.2.2.1
NAKAMA,Microsoft Active Directory Topology Diagrammer,2.2.4146
NAKAMA,IBM Tivoli Storage Manager Client,05.04.0100
NAKAMA,TivReDist,1.00.0000
NAKAMA,Adobe Reader X (10.1.0),10.1.0
NAKAMA,ActivePerl 5.10.0 Build 1004,5.10.1004
NAKAMA,Active Directory Migration Tool,2.0.0.0
NAKAMA,Microsoft Easy Assist v2,8.1.6416.0
NAKAMA,Microsoft SQL Server 2005 Express Edition (SQLEXPRESS),9.2.3042.00
NAKAMA,Dell OpenManage Server Administrator,5.5.0
NAKAMA,Windows Resource Kit Tools - GPInventory.exe,1.0.1361.27800
NAKAMA,Microsoft SQL Server VSS Writer,9.00.3042.00
NAKAMA,VMware Remote Console Plug-in,2.5.0.199067
NAKAMA,Microsoft SQL Server 2005 Tools Express Edition,9.2.3042.00
NAKAMA,Microsoft Visual C++ 2005 Redistributable,8.0.56336
NAKAMA,Microsoft Visual J# 2.0 Redistributable Package - SE,2.0.50728
NAKAMA,VMware vSphere Client 5.1,5.1.0.1557
NAKAMA,Windows Server 2003 Service Pack 2 Administration Tools Pack,5.2.3790.3959
NAKAMA,Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.4148,9.0.30729.4148
NAKAMA,Microsoft Visual C++ 2010 x86 Redistributable - 10.0.30319,10.0.30319
NAKAMA,Microsoft .NET Framework 2.0 Service Pack 2,2.2.30729
NAKAMA,Windows Support Tools,5.2.3790.3959
NAKAMA,Quest ActiveRoles Management Shell for Active Directory,1.5.1.2421
NAKAMA,MSXML 4.0 SP2 (KB954430),4.20.9870.0
NAKAMA,Debugging Tools for Windows (x86),6.12.2.633
NAKAMA,Microsoft SQL Server Setup Support Files (English),9.00.3042.00
NAKAMA,CBMR 5.0.1 Release 4,5.0.1
Desired output:
Node,Manufacturer,Model,Name,Version,AddressWidth,SerialNumber,Name,Version
NAKAMA,Dell Computer Corporation,PowerEdge 6650,Microsoft Windows Server 2003 R2 Enterprise Edition|C:\WINDOWS|\Device\Harddisk0\Partition1,5.2.3790,32,BZJS571,CBMR 5.0.1 Release 4,5.0.1
The original file is separated, and I only need some parts of it.
Each time I queried information I obtained a description of what I was querying and the result the line below it.
But now I need to organize data in this way:
First:
Node,Manufacturer,Model : I need all that
Second:
Node,Manufacturer,Model : I only need Manufacturer,Model (I will exclude Node from the remaining lines)
Third:
Node,AddressWidth : I only need AddressWidth (only one time will be enough)
Fourth:
Node,SerialNumber : I only need SerialNumber
Fifth:
Node,Name,Version : I only need Name,Version but only for line that contains CBMR
I am not sure if this is possible.

Here's one way using awk. Run like:
awk -f script.awk file
Contents of script.awk:
BEGIN {
FS=OFS=","
}
$1 == x=("Node") {
c++
f=sub(/[^,]*,/,"")
one = (one ? one : x) OFS $0
next
}
c==5 && $2 !~ /CBMR/ {
next
}
f==1 {
y=$1
gsub(/^[^,]*,|[ \t]*$/,"")
two = (two ? two : y) OFS $0
f=0
}
END {
print one ORS two
}
Results:
Node,Manufacturer,Model,Name,Version,AddressWidth,SerialNumber,Name,Version
NAKAMA,Dell Computer Corporation,PowerEdge 6650,Microsoft Windows Server 2003 R2 Enterprise Edition|C:\WINDOWS|\Device\Harddisk0\Partition1,5.2.3790,32,BZJS571,CBMR 5.0.1 Release 4,5.0.1
Alternatively, here's the one-liner:
awk 'BEGIN { FS=OFS="," } $1 == x=("Node") { c++; f=sub(/[^,]*,/,""); one = (one ? one : x) OFS $0; next } c==5 && $2 !~ /CBMR/ { next } f==1 { y=$1; gsub(/^[^,]*,|[ \t]*$/,""); two = (two ? two : y) OFS $0; f=0 } END { print one ORS two }' file

Related

Error alert only showing the first 20 characters. Dynaweb on IIS

I have an old dynaweb project, deployed on IIS, that I have recently migrated to a new windows server. The error alerts are not showing the whole error message. The engine code was copied as is.
What could be causing this?
Old setup
Microsoft windows server 2003.
32 Bit.
New setup
Windows server 2016 standard
64 Bit.
Microsoft SQL Server Management Studio 13.0.15000.23
Microsoft Analysis Services Client Tools 13.0.1601.5
Microsoft Data Access Components (MDAC) 10.0.14393.0
Microsoft MSXML 3.0 6.0
Microsoft Internet Explorer 9.11.14393.0
Microsoft .NET Framework 4.0.30319.42000
Operating System 6.3.14393

deploy mvc .net framework 4.5

I have got MVC website. based on .NET Framework 4.5.
I am trying to deploy the website on IIS 6.0
Here are the steps I have taken
Application Pool:
I have created application pool: Company.Attendance.
NOTE: Nowhere it asked me which .NET Version I am using?
Website
a. Create new website.
b. Description: company.attendance
c. IpAddress: Server Ip Address
d. Port: 80
e. Host Header for the website: [I left blank]
f. Path: ../../Views/Home/ [All views are defined here]
g. Permissions: Read, Run, Execute, Write
h. In the website properties, under tab Home Directory I have selected the application pool created above
i. In Home Directory TAB, under Configuration.
j. I inserted aspnet_iapi.dll
When I try to browse the application. I get the following error: Page cannot be found.
Can one tell me detailed steps to deploy mvc application [.Net Framework 4.5] on IIS 6.0 [Windows Server 2003].
Regards
I am trying to deploy the website on IIS 6.0
You can't. .NET Framework 4.5 requires Windows Server 2008 at least as can be seen in the System Requirements page:
System requirements
Supported Operating System
Windows 7 Service Pack 1
Windows Server 2008 R2 SP1
Windows Server 2008 Service Pack 2
Windows Vista Service Pack 2
Windows Vista SP2 (x86 and x64)
Windows 7 SP1 (x86 and x64)
Windows Server 2008 R2 SP1 (x64)
Windows Server 2008 SP2 (x86 and x64)
Hardware Requirements:
1 GHz or faster processor
512 MB of RAM
850 MB of available hard disk space (x86)
2 GB hard drive (x64)
The latest .NET framework version you could install on Windows Server 2003 is .NET 4.0.
You need at least IIS 7.0.
Here are the requirements for .NET 4.5 framework:
http://msdn.microsoft.com/en-us/library/8z6watww%28v=vs.110%29.aspx
You're going to have to use .NET 4.0, which porting your project over shouldn't be too painstaking.
Take your project and change compatibility to 4.0 for framework.
Fix some of the errors, and EF errors you may get, and repush to the IIS 6.0 server.
You need to ensure all the runtimes are installed, and the app is running on the
.NET 4.0 pool.
IIS 6 is part of Windows Server 2003 (and technically XP 64-bit).
.Net 4.5 cannot be installed on Windows Server 2003, thus IIS is not supported.

installshield 2012 LE and windows service for windows 2008 r2 64 bit VS.NEt 2012

I have windows service developed by VS.Net 2012 , Windows 7 32 bit and installshield 2012 LE for setup.
In the development machine everything going well ,installation completed and service working fine .
When upload it to the server (windows server 2008 R2 SP1 64bit) during the installation , installation stopped and rolled back because of error 1001 .
Advise Please
You're in a rough spot. Error 1001 comes from an InstallerClass, which uses a very fragile technology. The error 1001 has many different possible sources, ranging from an unhandled exception to what feels like the phase of the moon. However InstallShield LE doesn't really support installing services any other way.
The best advice I can offer is to use Windows Installer support for installing services. But in order to do that you will have to use a different installation creator. If you want to stick with InstallShield, the Professional edition has a view in which you can configure the Windows Installer support for services.
You can use Windows Installer XML (WiX) to author a merge module that installs a windows service and then consume that merge module in a InstallShield LE project. See:
Augmenting InstallShield using Windows Installer XML - Windows Services
Installshield LE 2012 doesn't support 64bit.
There is a new beta available of Installshield LE that is supposed to add this feature: http://blogs.msdn.com/b/visualstudio/archive/2013/08/15/what-s-new-in-visual-studio-2013-and-installshield-limited-edition.aspx
It's also supposed to support the proper Windows Installer for installing services now, even in the LE (via "3 Configure the Target System" -> Services"). However I've not been able to get that bit working yet - maybe there's some magic setting I've missed.
You could try using this version - let me know if you have any luck getting it working via the proper windows installer services!

Sharepoint's installation

I'm a newbie in Sharepoint 2010 and need some help.
I have downloaded two programs från Microsoft Academy for students
*SharePoint Designer 2010 (x86 - English)
*SharePoint Server 2010 (x64) - DVD (English)
Which of these programs do I need I started installing?
I also heard that you need to have a server in order to use Sharepoint. In my case I only have a Dell laptop (XPS M1710) with XP pro.
can I still use Sharepoint with full utilization without using a server?
// Fullmetalboy
SharePoint 2010 Server is 64-bit only, and can only be installed on a Windows Server unless you do a SKU Hack. Even then, I doubt it will want to install on Windows XP. Vista or Windows 7 is going to be required.
The designer is used purely as a simple content editor for an existing SharePoint installation.

How to get older CE 6.0 updates

I'm working on a project with CE 6.0 and I need to rebuild the tree. My problem is that I have to update the tree up to May 2009, this requires the 2008 rollup and the following 5 monthly updates, but I can't find them (there's the 2009 rollup and the following 2010 monthly updates).
I can't upgrade to a newer release as our platform is incompatible with R3 and post-May 2009 updates.
Of course if it would be possible to upgrade the platform so that it would be compatible with R3, I would upgrade, but it is currently not possible for two reasons:
There's a third party middleware that's not compatible with R3.
The product that has already been deployed (hundreds of thousands of devices) has currently an image based on CE 6.0 R2 upgraded to May 2009, an I want to recreate that environment.
Is there a place where I can download the "archived" updates?
The Mobile & Embedded Communications Extranet (ECE) is where the embedded channel resources are archived, but it is an authenticated access site. Credentials are usually obtained through the distributor that the embedded product development tools and licenses are obtained from (distributors like Arrow).
The embedded team blog could be a place to begin looking for contact information for folk within Microsoft.
Once you get access, Embedded > Products > Download Center > Windows Embedded > Windows CE contains:
Windows Embedded CE 6.0 R2 Release - Product Download
Applicable to: Embedded Distributors and OEMs Who Purchase Through Distribution
The Microsoft® Update Windows® Embedded CE 6.0 R2 software is now available for download on the ECE. Windows Embedded CE 6.0 R2 provides the latest breakthrough technologies that enable Windows® Embedded CE 6.0 device makers to quickly and easily build small footprint devices that connect to Windows Vista® and Windows® Server 2008.
...
Posted: November 13, 2007
Windows Embedded CE 6.0 Updates contains:
Product Updates for Microsoft® Windows® Embedded CE 6.0.
For individual updates prior to January 2009 please contact your MS Authorized Distributor.

Resources